Commit graph

10469 commits

Author SHA1 Message Date
Yuanhan Liu
25317dbd88 configure.ac: remove annoying change of INSTALL file
Every time we run ./autogen.sh, the INSTALL file would be replace by
/usr/share/automake-1.11/INSTALL, which changes the file. This is very
annoying since it messes up the result of 'git diff' and git always
wants to commit it.

Declare it as foreign would fix this annoying issue. Since it's not a
GNU project, it makes sense to do so.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-05-30 14:02:21 +01:00
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
Andrea Canciani
3e9895e951 png: Implement conversion of CAIRO_FORMAT_RGB30 to string
Fixes

png.c:55: warning: enumeration value ‘CAIRO_FORMAT_RGB30’ not handled
in switch
2012-05-26 16:05:07 +02:00
Andrea Canciani
afcbb7a2c5 build: Do not replace existing files
The existing INSTALL file is currently being replaced at every
autogen.sh run with the default one.

This is not desired, because INSTALL contains some cairo-specific
information.
2012-05-26 16:04:33 +02:00
Andrea Canciani
38d03ea748 build: Allow autogen-eration on systems without GTK-doc
The autogen.sh script fails if it cannot run gtkdocize. The absence of
this command should not cause cairo builds to fail, it should only
prevent the build of its documentation.

Fixes:
*** No GTK-Doc found, please install it ***

on systems without gtkdoc tools.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50356
2012-05-26 16:03:00 +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
f78696249f test: Increase surface size for get-path-extents
Whilst generating a glyph run from a string, any glyphs that are far
outside the surface (including a substantial guard region) are culled.
This affects the path extents. Workaround this by increasing the surface
size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:45:54 +01:00
Chris Wilson
3ae8bce832 test/record90: Rotate the reference so that it is wholly visible
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:27:47 +01:00
Chris Wilson
e73830915b test: Refresh unbounded-operator
Apparently this too suffered from bug-bo-collins and is fixed by
(bo-rectangular: Emit subsummed boxes for overlapping edges).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:20:50 +01: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
7b2f787d19 test: Exercise rectangular bo bug
Reported-by: S. Christian Collins <s_chriscollins@hotmail.com>
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
a845ebe32d test: Fix leak from xcb-snapshort-assert
==12598== 1,344 (768 direct, 576 indirect) bytes in 2 blocks are
definitely lost in loss record 512 of 519
==12598==    at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12598==    by 0x4C76501: _cairo_image_surface_create_for_pixman_image (cairo-image-surface.c:176)
==12598==    by 0x4C76953: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:345)
==12598==    by 0x44CFAC: draw (xcb-snapshot-assert.c:36)
==12598==    by 0x40E14C: cairo_test_for_target (cairo-test.c:923)
==12598==    by 0x40EEA7: _cairo_test_context_run_for_target (cairo-test.c:1545)
==12598==    by 0x40BD53: main (cairo-test-runner.c:254)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 12:12:03 +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
Chris Wilson
099420a07c spans: Debug input paths and polygons
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 17:57:24 +01:00
Chris Wilson
f7d937670c arc: Use user endpoint for final step
Eliminate numerical inaccuracy from accumulating angle through
the floating point step value by using the exact end-value for the last
arc segment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 16:09:29 +01:00
Alexandros Frantzis
6867383017 gl: Provide a shader implementation of repeat wrap modes
In OpenGL ES 2.0, repeat wrap modes (GL_REPEAT and GL_MIRRORED REPEAT) are
only available for NPOT textures if the GL_OES_texture_npot is supported.
This commit adds a shader implementation of these wrap modes for use by
devices that do not support GL_OES_texture_npot.
2012-05-12 11:09:26 +01:00
Alexandros Frantzis
82f69d1ef7 gl: Simplify GL wrap parameter setting code 2012-05-12 11:06:21 +01:00
Chris Wilson
6cd1f5040f clip: Apply clip boxes to the clip surface
As we convert the unaligned clip boxes to a region, we need to process
the intersection of the boxes with the clip surface as a separate step.

Fixes tighten-box for the base compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 23:14:21 +01:00
Chris Wilson
4ea3ace6c8 spans: Only fallback for a clipmask if unbounded
For a bounded operation with a clip we will already have performed the
clip geometrically.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:53:55 +01:00
Chris Wilson
cd1004ce19 traps,spans-compositor: Avoid mistreating unaligned clips as aligned
An unaligned clip requires careful handling, and so exclude processing
along the fast paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00