Commit graph

6702 commits

Author SHA1 Message Date
Chris Wilson
fc501fd6b5 tor-scan-converter: Always recompute min-height following edge removal
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 17:26:11 +01:00
Chris Wilson
1bc696a8fd spans-compositor: After polygon intersection the fill rule is always non-zero
As it turns out due to the rules of polygon intersection, there is never
any overlapping spans so the choice is arbitrary. However, lets be
consistent with the rest of the code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 17:26:11 +01:00
Chris Wilson
37532b47c0 scaled-font: Take lock around disposing of an empty page upon alloc failure
Spotted by code inspection whilst looking at #50705

References: https://bugs.freedesktop.org/show_bug.cgi?id=50705
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 15:15:55 +01:00
Adrian Johnson
2f1d6b27e8 cff-subsetting: Ignore charset for non cid fonts
Fixes crash in https://bugzilla.gnome.org/show_bug.cgi?id=677422
2012-06-07 19:18:52 +09:30
Chris Wilson
9fa047c0ea composite-rectangles,scaled-font: Use accurate extents if the font is broken
If the font metrics appear broken, i.e. key values are being reported as
zero, skip approximating the bbox of the glyph string.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50688
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 20:18:03 +01:00
Adrian Johnson
0210499578 pdf: fix the offset of padded images
Bug 50598
2012-06-02 19:01:18 +09:30
Chris Wilson
f1b546b1a2 Erradicate internal use of cairo_surface_get_type()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 18:17:33 +01:00
Chris Wilson
e23d179e08 Erradicate internal use of cairo_surface_get_content()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:46:25 +01:00
Søren Sandmann Pedersen
4b5d3436a3 image: Fix bugs related to glyph mask creation
In addition to fixing a bug 7d8d98b91c releated to
expanding a8 glyphs into a8r8g8b8, this commit also added an
optimization where if the first glyph had format a8r8g8b8, the mask
was created in this format from the beginning instead of later
converting from a8 to a8r8g8b8.

However, the optimization had two bugs in it:

(1) The computed stride was 3 * width, not 4 * times width, and
(2) In the case where the mask was allocated on the stack, it was
    allocated as PIXMAN_a8 and not a8r8g8b8.

The commit fixes both bugs.
2012-06-01 08:13:17 +01:00
Chris Wilson
c0a92bf832 surface: replace map-to-image clone's use of user_data with parent pointer
Removes an another undeclared PLT entry and prevents mixing of user_data
with internal state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 18:30:58 +01:00
Chris Wilson
9e933d4b87 gl: Add missing cairo-private to _cairo_gl_composite_with_clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 18:25:09 +01:00
Chris Wilson
9275b4d5aa surface: Eliminate PLT entries for map-to-image
Use the internal symbols internally.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 18:22:11 +01:00
Chris Wilson
2c6ba9a873 image: silence make check
The check for standalone headers requires that the
cairo-image-surface-inline.h include the cairo-surface-private.h

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 18:10:36 +01:00
Chuanbo Weng
98c3ed1dbd gl: Do correct translation and lerp in gl-traps-compositor.
Coordinate translation is necessary in composite_boxes(), composite()
and composite_traps(). The translation value should set to correct
value in traps_to_operand(). Also fix the bug in lerp().
2012-05-31 11:38:19 +01:00
Chris Wilson
7d8d98b91c image: Upconvert glyphs through a WHITE source when adding to the glyph mask
We need to scale the channels of the glyph into the destination (and
indeed expand a8 into a8r8g8b8) when adding into the mask. Normally we
have matching formats for the glyph surfaces and the temporary mask,
for which we can continue to take the faster path.

Reported-by: Søren Sandmann <sandmann@cs.au.dk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 11:25:11 +01:00
Adrian Johnson
3f325764e5 pdf: Don't use extents when acquiring a RASTER_SOURCE pattern
because the pdf surface reuses the image each time the pattern is used.
2012-05-31 17:46:31 +09:30
Chris Wilson
f3a1ee5edd gl: Do no access ctx after release during map-to-image
Based on a patch by Yuanhan Liu.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 11:10:34 +01:00
Yuanhan Liu
9340fcd965 gl: use _cairo_gl_operand_copy to fix unblanced reference count
Use _cairo_gl_operand_copy to do the operand copy instead of by
something like *operand = surface->operand.

This would fix a crash introduced by operator-source test case, which
forgot to do reference while copying operand but did dereference while
destroying surface at combine_clip_as_traps().

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
[ickle: drop the extra reference for the owned surface]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 10:43:09 +01:00
Adrian Johnson
f3ae830207 pdf: merge _emit_recording_surface and _emit_recording_subsurface into the one function 2012-05-27 22:59:13 +09:30
Adrian Johnson
5dd119c1fe ps: check if EXTEND_PAD group can be painted with EXTEND_NONE 2012-05-27 22:32:41 +09:30
Adrian Johnson
fcfa45c9f7 pdf: fix smask gradient bbox 2012-05-27 11:55:09 +09:30
Chris Wilson
29a42ae682 surface: Kill imagesurf temporary variable
The local alias to &image->base is more confusing that the code it
replaces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-26 15:21:23 +01:00
Chris Wilson
11e276753f image: Propagate errors from clone_subimage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-26 15:21:23 +01:00
Andrea Canciani
fc33cc3c3a quartz: Provide a valid implementation of map_to_image
and reuse it to implement acquire_source.

Fixes

cairo-quartz-surface.c: In function '_cairo_quartz_surface_map_to_image':
cairo-quartz-surface.c:1568: warning: return from incompatible pointer type
cairo-quartz-surface.c:1576: warning: return from incompatible pointer type
2012-05-26 16:07:47 +02:00
Andrea Canciani
a8a4a8dfd4 quartz: Mark surfaces created clear as is_clear
This might provide a speedup when clearing an already clear surface
and is required by cairo_surface_create_similar().

Fixes zero-mask.
2012-05-26 16:07:33 +02:00
Andrea Canciani
3735881e38 quartz: Silence warning
cairo-quartz-surface.c:177: warning: enumeration value
'CAIRO_FORMAT_RGB30' not handled in switch
2012-05-26 16:07:26 +02:00
Andrea Canciani
13b7364836 surface: Use the internal map/unmap
In many places Cairo maps/unmaps surfaces to perform operations on the
raw image, but it doesn't care about the format being invalid. All of
these are appropriate users of _cairo_surface_map_to_image().
2012-05-26 16:07:00 +02:00
Andrea Canciani
37c5c2dbe5 surface: Only use non-NULL extents for internal mapping
_cairo_surface_map_to_image() requires the input extents to be
non-NULL.
2012-05-26 16:06:39 +02:00
Andrea Canciani
d6fb8d2134 surface: Make backend-specific map/unmap functions symmetric
Map allocates a surface. Symmetrically, unmap should destroy it.
2012-05-26 16:06:31 +02:00
Andrea Canciani
df7829e2cc surface: Make map_to_image return cairo_image_surface_t*
This makes it easier to check that the funciton is returning the
correct type of surfaces.
2012-05-26 16:06:26 +02:00
Andrea Canciani
10c0a1c68c surface: Define private map/unmap functions
Cairo backends often need to map/unmap to a raster surface but they
don't care about the pixel format, as Pixman will be doing the format
handling.

Cairo users cannot know how to access the raw data if the format is
invalid.

The two different scenarios call for different guarantees on the
returned surface.

The private map/unmap functions also makes it possible to simply
return the status upon unmapping.
2012-05-26 16:06:21 +02:00
Chris Wilson
465319ce82 gl: Use core GL_STENCIL8_DEPTH24 for gl_flavor=desktop
Jesse complained that --enable-gl --enable-glesv2 wasn't pulling in the
right headers, and in particular GL_STENCIL8_DEPTH24_OES was undefined
but being used. In this case we can simply use the identical
GL_STENCIL8_DEPTH24 instead.

Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 20:39:34 +01:00
Martin Robinson
52b7622a6c gl: Fix compilation failure for flush cleanup. 2012-05-23 13:59:02 -07:00
Martin Robinson
bf9c295953 gl: Simplify switching between primitive types
Simplify the code that switches between primitive types by adding
a new member to the context which tracks the currently active
primitive type.
2012-05-23 12:40:57 -07:00
Chris Wilson
c09be68112 bo-rectangular: Emit subsummed boxes for overlapping edges
Fixes bug-bo-collins

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49446
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 11:50:34 +01:00
Chris Wilson
aed94a5bc6 gl: Replace vbo with static allocation and immediate arrays
Some drivers have terrible latency issues when using VBO and for our
dynamic use-case (we never reuse a VBO currently) there is little
benefit from using a VBO and often a loss of performance from doing so.
And there is the benefit from reducing the number of our own code paths.
2012-05-21 11:32:23 +01:00
Chris Wilson
2879e656b9 wideint: Fix compilation failure for bare use of uint64_t for !HAVE_UINT64_T
Reported-by: Hakki Dogusan <dogusanh@tr.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 10:55:26 +01:00
Chris Wilson
dad69ce4d5 win32: Fix return value for cairo_time_get
Without uint64_t we need to construct a cairo_int64_t from the struct of
smaller 32-bit types rather than just casting the larger 64-bit value.

Reported-by: Hakki Dogusan <dogusanh@tr.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 10:55:25 +01:00
Chris Wilson
5a7a9c93e7 image: Tidy lerp8x4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 10:41:12 +01:00
Martin Robinson
ced090871b gl/msaa: Improve fallback detection
Rename should_fall_back to can_use_msaa_compositor to make it
more comprehensible and also modify the logic to fall back
when the antialias mode is not "fast" or "default."
2012-05-17 14:52:10 -07:00
Martin Robinson
707bb86639 gl/msaa: Lazily flush the context
Instead of conservatively flushing after every single drawing
operation. Wait until we are certain we need to flush, which
in the case of the MSAA compositor is when we start compositing
with a different type of geometry.
2012-05-17 14:21:25 -07:00
Martin Robinson
4b3ad4e8da gl/msaa: Implement glyph rendering
Instead of falling back to the traps compositor to do glyph
rendering, handle it in the MSAA compositor. This allows using
the stencil buffer or scissor to clip and simplifies the MSAA
code path.
2012-05-17 14:02:18 -07:00
Martin Robinson
e3f5b14fba gl/msaa: Wait to clip until compositing begins
The MSAA compositors clips in a unique way We'd like to
share this method with the text rendering path, so we move
it to cairo-gl-composite so that it works in a way very
similar to clipping with the spans and traps compositors.
2012-05-17 13:56:38 -07:00
Martin Robinson
29b243325c gl/msaa: Support for non-texture surfaces
Add full support for non-texture surfaces, by correctly
querying primitives for stencil and multisample bits.
2012-05-17 13:13:40 -07:00
Henry (Yu) Song
9208dd6230 gl/msaa: Support the OpenGLES EXT multisampling extension
Add support for OpenGLES GPUs that support the EXT multisampling
extension.
2012-05-17 13:08:46 -07:00
Henry (Yu) Song
ac8d50f04c gl/msaa: Use unsigned short to build the index array
Some GPUs have trouble accepting vertex index data as
integers. Using unsigned shorts expands support.
2012-05-17 12:49:55 -07:00
Henry (Yu) Song
5ae53c933a gl/msaa: Implement paint via masking
Instead of falling back to the spans compositor, let the msaa
compositor handle painting. This ensure clipping is handled
in a consistent way with the rest of the msaa compositor.
2012-05-17 11:22:25 -07:00
Henry (Yu) Song
4d9064d578 gl/msaa: Add ARB multisampling support
This implementation is not very efficient at the moment and does not
work with platforms using the incompatible IMG extension (mobile
GPUs).  Performance improvements and mobile GPU support will follow.
2012-05-17 11:06:47 -07:00
Adrian Johnson
50f08352f4 pdf: check if EXTEND_PAD group can be painted with EXTEND_NONE
to avoid the fallback
2012-05-16 20:57:47 +09:30
Chris Wilson
e41dffb329 stroke: Don't drop clockwise==0 lines
If the join indicates the pair of edges are parallel, we may be
considering the final segment of the spline with a different tangent
vector than the slope of the final edge and so lead to false dropping of
an edge. This has the effect that the line segments between 'arc arc arc
arc' (a rounded rectangle) are no longer horizontal or vertical. As path
construction tries to eliminate joins between colinear segments, this
optimisation should not be required anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 18:11:28 +01:00