Commit graph

6671 commits

Author SHA1 Message Date
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
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
Chris Wilson
de1150cc0e spans-compositor: Add tracepoints for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
197e5b7324 spans-compositor: Handle unaligned unbounded boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
117a44a335 gl: Reject SOURCE + mask in composite_boxes()
As SOURCE requires a bounded operation and the GL compositor only
implements a simple operation (i.e. it just blits from source to
destination instead of applying a linear interpolation as required), we
need to reject the operation and fallback. In the future, we should
make the linear interpolation available through a GL shader or as a
dual-source blend (better).

Spotted-by: Chuanbo Weng <strgnm@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 17:30:42 +01:00
Chuanbo Weng
0196327b30 gl: Convert CLEAR to DEST_OUT when there's a mask for composite_boxes.
As Cairo's CLEAR sematics are for a bounded operation, and GL's uses the
simple semantics for its CLEAR composite, we need to convert the
operation into an equivalent DEST_OUT when we have a mask.
2012-05-11 17:11:55 +01:00
Chris Wilson
9ecf2f7c4f damage: Prevent reducing an error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 21:01:36 +01:00
Chris Wilson
f4631dca37 damage: Prevent accumulating damage to an error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 21:00:49 +01:00
Chris Wilson
50e51389bd damage: Avoid freeing the NIL error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 20:58:33 +01:00
Uli Schlachter
3bff546ebe c_surface_set_mime_data: Remove duplicate "Since"
This fixes the following message from "make check":

./cairo-surface.c (1192): ERROR: cairo_surface_set_mime_data: Duplicate 'Since'
field

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Uli Schlachter
fcccb1a65a check-doc-syntax: Find duplicate "Since:" tags
It makes no sense to say more than one time when some symbol was introduced.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Uli Schlachter
a184de9064 check-doc-syntax: Make this work again
Commit ed90616b77 changed the way the awk script gets invoked. Due to a
missing "test", this resulted in the awk script never getting invoked at all.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Henry (Yu) Song
3e02dccb97 gl/msaa: Add support for unbounded operators
When filling and stroking with an unbounded operator, first fill
and stroke to a temporary surface and then paint the entire surface
back to the original target.
2012-05-08 12:48:30 -07:00
Henry (Yu) Song
b099f8b0c7 gl/msaa: Support for masking
Add support for masking in the OpenGL MSAA compositor. This is
accomplished simply by properly setting up the masking source,
emitting the entire bounded composite region, and unforking
vertex emission.
2012-05-08 12:13:42 -07:00
Henry (Yu) Song
929a96ed03 gl/msaa: Support for texture sources
Add support for texture sources, by unforking _cairo_gl_composite_begin.
_cairo_gl_composite_begin_tristrip is now just a small wrapper. Also
properly emit the source texture coordinates when emitting tristrip
vertices.
2012-05-08 11:42:29 -07:00
Henry (Yu) Song
a60bb83f28 gl/msaa: Prevent stroke overlap
When stroking we do not send our polygon to the tessellator, so
it may have overlapping stroke components. Use the stencil buffer
to prevent stroke components from overlapping.
2012-05-08 11:06:31 -07:00
Uli Schlachter
138e595c11 Remove some dead code
This code could never be executed, because the status variable doesn't get set
since the last time it is checked and errors get returned to the caller.

This was noticed while looking into the build log provided by
http://lists.cairographics.org/archives/cairo/2012-April/022993.html

Reported-by: Ryan Schmidt <cairo-2012b@ryandesign.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:14:54 +02:00
Uli Schlachter
494cfd7eb9 Remove some unused functions
All of these are unused since af9fbd176b "Introduce a new compositor
architecture". Since no one complained yet, I guess that means that we don't
need these any more. :-)

This was noticed while looking into the build log provided by
http://lists.cairographics.org/archives/cairo/2012-April/022993.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:14:54 +02:00
Chuanbo Weng
748dcdef4b gl: fix the translate value in copy_boxes.
Fixes 36 test cases (such as push-group-color)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48221
2012-05-04 10:15:01 +01:00
Chris Wilson
db4ee947c3 Split finish into multiple stages
In order to handle the snapshot copy-on-write losing a race with another
thread using the snapshot as a source, we may find the target acquires a
fresh reference as we attempt to finalize it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Chris Wilson
52dfa038b9 snapshot: Avoid triggering assertion for grabbing the target during destroy
If the source wins the race to acquire the original surface as it is
being destroyed, it triggers an assertion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Chris Wilson
f62f8f907d snapshot: Hold a reference to target whilst querying
Due to race with cow and accessing target from multiple threads, we need
to be careful that we always acquire a reference for our access to
the snapshot target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Søren Sandmann Pedersen
af3c8abbce Revert "Use pixman glyphs"
This was pushed accidentally - apologies.

This reverts commit 752c3b69e0.
2012-04-30 12:02:38 -04:00
Søren Sandmann Pedersen
752c3b69e0 Use pixman glyphs 2012-04-30 09:41:44 -04:00
Chris Wilson
ed90616b77 check-doc-syntax: Only parse the source files for incorrect tags
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 19:29:12 +01:00
Chris Wilson
c16cdf0b4e check-doc-syntax: Fix handling of return value in make check 2012-04-29 19:29:12 +01:00