Commit graph

6273 commits

Author SHA1 Message Date
Martin Robinson
9f85eb52d8 gl/msaa: Introduce an MSAA compositor for OpenGL
The MSAA compositor will composite OpenGL primitives directly and
anti-alias via the GPU.
2011-10-13 14:42:09 +01:00
Chris Wilson
7df2c113b1 ft: Add missing break to enable BGR subpixel rendering
Reported-by: Ingo Ruhnke <grumbel@gmx.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40456
Original-patch-by: Simon Elmir <nerd65536+freedesktop@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-13 13:06:31 +01:00
Chris Wilson
282cfff156 recording-surface: Initialize optimize-clears before use in snapshotting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:12:09 +01:00
Chris Wilson
f84f6ecaa4 gstate: Prevent leak of old clip when creating a group with translation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:09:12 +01:00
Chris Wilson
8f34fa033e spans: Refresh polygon limits after trimming the composite extents
Trimming the composite extents may result in the clip being
reconstructed, but we the polygon continued to hold a reference into the
freed clip's array of boxes. So if we intend to reuse the polygon limits
after performing the clip we need to refresh them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:04:16 +01:00
Chris Wilson
d576319e13 recording-surface: Optimize away anything below an opaque fill
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 16:33:45 +01:00
Chris Wilson
8f5736b8b1 recording-surface: Free the contents of the command array when clearing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 16:19:58 +01:00
Chris Wilson
9c63168b5f clip: Replace the original clip when transforming
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 16:19:33 +01:00
Chris Wilson
17173f9613 clip: Free the freed clip pool on reset
To keep valgrind happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 16:01:42 +01:00
Chris Wilson
a7d0470357 surface-clipper: Fix path leak due to typo
When finishing the path, it is better to call fini() rather than init()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 15:56:36 +01:00
Chris Wilson
b2aa687de6 spans: Propagate internal status when retrieving the clip surface
Including the information that there is nothing to do due to being
all-clipped-out.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 14:50:41 +01:00
Chris Wilson
5d1a17f354 mono: Silence valgrind by placing a sentinel value in the sorted buckets
If the edges finish before we complete the last scanline, we will
attempt to skip over the remaining lines using min_height of the
sentinel edge (MAX_INT). This causes us to read beyond the end of the
array of insertion buckets, unless we place a sentinel value in there to
break the loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 14:26:08 +01:00
Chris Wilson
88a1b83177 observer: Fix typo and handle the condition of no script device
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-11 13:49:36 +01:00
Chris Wilson
c8bfa8c088 xcb: Re-enable glyph rendering
I lost the '&& 0' I put in to disable the glyph rendering until I had
the glyph cache integration working again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-11 12:44:25 +01:00
Chris Wilson
a09f70586d gl: Remove unused alpha argument from operand_emit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-11 11:58:10 +01:00
Chris Wilson
4f5d42f6e5 gl: Spans start after the mask, not coincident!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-11 11:39:28 +01:00
Chris Wilson
4163391322 gl: Include use-coverage in shader hash
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-11 11:39:27 +01:00
Chris Wilson
3d51ec8a79 botor: Remove a couple of inlines to cleanup -Winline
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-10 15:22:37 +01:00
Chris Wilson
34f507a919 gl: Need to increment reference count when copying operands
Or else watch everything die with use-after-free of the cached
gradients.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Chris Wilson
a6c27b500b gl: Basic fixes to get cairo-gl running again
Let there be textures!

Unbreak the setup of surface operands after my lazy convertion to the
new compositor interface. This is still only the first step, but it gets
the essentials up and running again, enough to keep me happy whilst
sitting in the airport.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Chris Wilson
22c485017d gl: Declare coverage input for fragment shaders.
The most minor of oversights which prevented compilation of any spans
based compositors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Uli Schlachter
d825f6a263 clip_intersect_boxes: Fix memleak
There were two code path were we already had called
_cairo_boxes_init_for_array() on a local variable, but we tried to return
without going through _cairo_boxes_fini().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:39:25 +02:00
Uli Schlachter
dca4e6c2dd clip: Fix clip-double-free
If the call to _cairo_clip_set_all_clipped() right after this is hit,
clip->boxes was freed twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:37:03 +02:00
Uli Schlachter
a419d00fbe flush: Detach mime data
Drawing directly to a surface has to be surrounded with cairo_surface_flush()
and cairo_surface_mark_dirty().

However, if the surface has mime data associated, this would hit the following
assert:

lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle:
Assertion `! _cairo_surface_has_mime_data (surface)' failed.

This is now fixed by detaching all mime data in cairo_surface_flush().

Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409

Fixes: create-from-png, create-from-png-stream

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:22:26 +02:00
Adrian Johnson
61fdaaf7e5 cff: fallback if seac style endchar is found
Bug 41548
2011-10-09 15:25:42 +10:30
Adrian Johnson
e2dca74edf cff: in CID fonts the CID is the glyph index
Need to use charset to map CID to GID.

Bug 41548
2011-10-09 14:58:13 +10:30
Uli Schlachter
960ae5ab2e Make the new mime-surface-api succeed
When removing mime data, _cairo_user_data_array_set_data () is called with a
NULL argument. This leaves behind an entry with key == NULL in the user data
array. Skip those entries instead of dereferencing NULL.

(The NULL entry in the array let's us avoid moving data around and/or doing a
memory allocation later, so I guess it might be a good idea to keep that)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 21:00:23 +02:00
Andrea Canciani
8664df767c quartz: Fix the 32-bits build on MacOSX 10.7
FMGetATSFontRefFromFont() is not public on Lion nor on 64-bits
Frameworks, but it seems to be available in the dynamic libs, hence we
can dlsym() it just like other private functions.

Works around the error:
cairo-quartz-font.c: In function 'cairo_quartz_font_face_create_for_atsu_font_id':
cairo-quartz-font.c:830: error: implicit declaration of function 'FMGetATSFontRefFromFont'

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39493
2011-10-01 09:24:08 -07:00
Chris Wilson
538fa0d6fb fill: Fix unantialiased rectilinear-fill-to-boxes
We were calling the antialias close function from the unantialiased
paths - a function that operates on a completely different structure to
the one passed in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 15:58:14 +01:00
Chris Wilson
719bef0c90 image: Enable use of LERP_SRC for masked source composition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 13:07:23 +01:00
Chris Wilson
2994b0c634 stroke: Use the tessellator to resolve overlapping strokes
If the stroke is too large, the strokes around the box overlap and we
fail to generate the canonical form of the boxes. So if we detect that
the boxes overlap, feed them through the tessellator to reduce them to
canonical form.

Fixes line-width-overlap.

Based on a patch by  Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-29 00:26:06 +01:00
Chris Wilson
9fe7022790 polygon-intersect: Remove surplus edge direction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-26 13:25:58 +01:00
Chris Wilson
1a1b39a9c3 script: compile without
The surface observer gained a dependency on script, make it optional.
2011-09-26 11:52:48 +01:00
Chris Wilson
bbacfc4e83 win32: Compile, but broken
First step: just make it compile again but crash upon usage.
2011-09-26 11:52:05 +01:00
Chris Wilson
d71ce5e0dd spans: Fix empty polygon unbounded fixup
There is a subtle flaw in the current querying of polygon extents; it
simply returns the limits and not the point extremeties and certainly
not the tessellation extents. Computing that is likely to take long than
rendering the polygon. This does mean that we need to also fixup the
extents prior to performing the empty unbounded fast path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 23:24:25 +01:00
Uli Schlachter
f162f7ebb4 xcb: Fix device offsets with unmap_image()
The source and target x/y coordinates were swapped. No idea why this only now
caused a test suite failure, perhaps something recently started using SHM?

Fixes: map-bit-to-image, map-to-image-fill

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 22:26:09 +02:00
Uli Schlachter
880321ae9d xcb: Fix a "incompatible pointer" compiler warning
cairo-xcb-surface.c:790:2: warning: return from incompatible pointer type

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 22:24:58 +02:00
Uli Schlachter
aa16e3e666 xcb: Honor clips for defer clear
This bug was accidentally introduced in fd613cb9f9.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 21:18:57 +02:00
Uli Schlachter
87fdc4356f xcb: Don't try to fallback more than once
This fixes the following assert for pretty much every single xcb-fallback test:

cairo-xcb-surface.c:320: _get_image: Assertion `surface->fallback == ((void *)0)' failed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 20:46:24 +02:00
Chris Wilson
f8c4686310 image: don't offset by device transform for replay onto source surface
It is already captured by the pattern extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:34:23 +01:00
Chris Wilson
5f0dcf610f image: clip the replay to the sample extents in device space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:05:31 +01:00
Chris Wilson
da95bdfcd7 wrapper: transform the clip into device space
We need more than just mere translation!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:04:29 +01:00
Adrian Johnson
a810b012cf subsets: latin char map needs to belong to the font, not the subset 2011-09-20 00:03:33 +09:30
Chris Wilson
fd613cb9f9 xcb: track fallback damage
And only upload the parts of the image that are modified during the
fallback. I have to keep reminding myself that the goal is always to
reduce the amount of fallbacks required...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 15:23:57 +01:00
Uli Schlachter
36a1423045 xcb: Remove an unused variable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00
Uli Schlachter
cdd75ec407 xcb: Use a mask in _composite_boxes() when needed
This doesn't just need a clip without any path, it also needs pixel aligned
boxes.

This improves the result for unaligned boxes in tighten-bounds.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00
Uli Schlachter
e580565e28 xcb: Stop using _cairo_clip_get_surface()
This function changed its behavior and no longer does what we want. Instead,
this now uses its own function which uses _cairo_clip_combine_with_surface().

This fixes crashes in the tighten-bounds and random-clip tests. These happened
because cairo-xcb was trying to be clever. ;-)

Since _cairo_clip_get_surface() did less, the resulting surface had
deferred_clear == true and picture == XCB_NONE. The code then tried using this
evil picture and either ran into an assert() or caused a BadPicture error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00
Uli Schlachter
6fb4c3ae35 _cairo_clip_get_surface(): Don't lose errors
If one of the _cairo_surface_fill() calls failed, this function would stop and
return an intermediate result, thus hiding the error that happened.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00
Andrea Canciani
74e7f3b441 quartz-font: Fix scaled font backend hooks
In af9fbd176b the show_glyphs hook has
been removed from cairo_scaled_backend_t, but quartz-font was not
updated.

Fixes:

cairo-quartz-font.c:798: warning: initialization from incompatible pointer type
2011-09-18 09:13:17 -07:00
Andrea Canciani
7827f46d7c quartz: Fix build
Fix a bunch of typos and "wrong number of arguments" errors.
Clean up some "unused variable" errors.
2011-09-18 08:48:05 -07:00