Commit graph

10739 commits

Author SHA1 Message Date
Chris Wilson
fd34f420ec compositor: Pass back the internal failure
In order to pass back a CAIRO_INT_STATUS_UNSUPPORTED, we need to use the
internal error surface creation functions as they do not assert on
private error codes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 18:37:08 +00:00
Chris Wilson
14c32ee1cf compositor: Convert image surface into backend source
Before passing a surface to the backend composite functions, they expect
them to be a native source. The copy'n'paste code for the mask
compositor forgot to perform the conversion upon the clip surfaces,
which originally were native to the backend and are now images.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 18:37:08 +00:00
Chris Wilson
7012334ebb xlib: Handle lack of XRenderFillRectangles
Remember to check for a supported render version before making a
FillRectangle request, and fallback to the core protocol where possible
instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 18:37:08 +00:00
Chris Wilson
503b6b9e2e xlib: Only fallback through the mask intermediate if we can composite the mask
Before rendering into the mask, we should first check whether the
subsequent call to composite the mask will trigger a fallback. In that
case, we should fallback earlier and do the operation in place.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 13:18:26 +00:00
Martin Robinson
1bcd59ef4c gl/msaa: Rely on the stencil buffer to cache the clip
When using a texture surface the depth/stencil buffer is private to
cairo so we can rely on the fact that any previously painted clip is
still valid.

We also only scissor when there's a previously painted clip on the
stencil buffer, otherwise we disable the scissor test. This fixes a few
test cases.
2013-01-09 14:33:41 -08:00
Martin Robinson
d524697ede gl/msaa: No need to set the clip when masking
After 5e9083f882 there's no need to set a
clip on the cairo_gl_composite_t when masking. Clips are converted to
traps and rendered directly when masking now.
2013-01-09 14:33:41 -08:00
Chris Wilson
17418371b6 xcb: _cairo_scaled_font_reset_cache does it own locking
So we can drop ours.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 15:06:28 +00:00
Chris Wilson
dd20c1f4d6 xlib: map-to-image requires an extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 12:38:09 +00:00
Chris Wilson
351a9e756d stroke: Flip the dev slope as well for computing the cusp on a degeneracy
Otherwise, the join think it starts and end in exactly the same
direction and elimiates the round capping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 12:31:10 +00:00
Chris Wilson
14720cd0db gstate: Use the polygon intermediate for geometry queries
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 12:11:25 +00:00
Chris Wilson
a942938e90 scaled-font: Fix use after free when clearing the glyph cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 00:36:13 +00:00
Chris Wilson
c5b353c372 scaled-font: Make reset-font-cache threadsafe
Stop trying to workaround the destroy-callback requiring the font mutex
as we already hold the mutex whilst cleaning up the font caches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-09 00:26:19 +00:00
Martin Robinson
d1184b69e8 gl: Do less work when acquiring and releasing devices
After acquiring a GL device and the same GL context, surface, and
display combination is already active outside of Cairo, do not ask EGL
or GLX to change the current context as that may cause a flush on some
drivers. Also do not unset the context when releasing the device for the
same reason.
2013-01-08 15:09:33 -08:00
Chris Wilson
7401455cb4 image: Allocate a temporary buffer for inline span composition
Allow the inpline span compositor to operate on wider images than its
temporary buffer by allocating a scanline mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 22:26:25 +00:00
Chris Wilson
0d38518c38 scaled-font: Remove a non-threadsafe double-freeze assert
Sadly we cannot check ahead of acquiring the lock whether we hold the
lock. Just have to rely on lockdep.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 18:52:08 +00:00
Chris Wilson
e4acba6d1d xlib/shm: Only destroy an existing damage
_cairo_damage_destroy() does not like to be passed a NULL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 16:38:11 +00:00
Chris Wilson
2ed484817e xlib/shm: Discard damage upon shm finish
Both to make sure we do not leak the memory, but to also prevent
_cairo_xlib_surface_put_shm() from operating upon the finished shm
surface after the display is closed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58253
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 16:07:32 +00:00
Chris Wilson
b5dcc8ce44 scaled-font: Hold the scaled font mutex whilst reaping from the global cache
If we need to reap the global cache, this will call back into the scaled
font to free the glyph page. We therefore need to be careful not to run
concurrently with a user adding to the glyph page, ergo we need locking.
To complicate matters we need to be wary of a lock-inversion as we hold
the scaled_font lock whilst thawing the global cache. We prevent the
deadlock by careful ordering of the thaw-unlock and by inspecting the
current frozen state of the scaled-font before releasing the glyph
page.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:03:25 +00:00
Chris Wilson
c4ea7b13b4 scaled-font: Assert if attempting to finish a frozen font
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:03:06 +00:00
Chris Wilson
4d4bf8fddf scaled-font: Free the cached glyphs from the font before taking the global lock
In the case of a recording surface we may recurse into the global glyph
cache so we need to be careful and stage the ordering of how we free the
glyphs. So first we finish any information and surfaces from the scaled
font glyph cache (and so triggering recursion into other scaled fonts)
and then take the global cache and remove our pages.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54950
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:02:27 +00:00
Chris Wilson
44a093eb95 scaled-font: Always hold the mutex even for single glyph probes
The freeze/thaw routines have a side-effect of managing the global glyph
cache in addition to taking the mutex on the font. If we don't call
them, we may end up indefinitely keeping the global glyph cache frozen
(effectively leaking glyphs to the maximum of all open fonts) and
triggering asserts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:02:26 +00:00
Chris Wilson
80cc532271 script: Thaw the scaled font cache on the error path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:38 +00:00
Chris Wilson
e1307da861 script: Simply exchange source/dest images for _set_source_image
But note we can only do the exchange if they do indeed match and
there are no other references (the objects are only on the stack).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
146da77d85 script: Attempt to decompress images in place
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
5f2e89660d image: Call pixman without a mask for opaque regions of inplace_spans
Speedups
========
firefox-paintball  59462.09 -> 40928.76:  1.45x speedup
 firefox-fishtank  43687.33 -> 34627.78:  1.26x speedup
     firefox-tron  52526.00 -> 45754.73:  1.15x speedup

However in order to avoid a regression with firefox-talos-svg we need to
prevent splitting up the scanline when using a gradient source.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-07 17:58:02 +00:00
Chris Wilson
a73e7ff018 xlib: Simplify source creation by use of map-to-image
We were open-coding the functionality of map-to-image inside the source
creation routines. so refactor to actually use map-to-image instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 11:30:02 +00:00
Chris Wilson
4f142f3a7b xlib/shm: Only mark the shm pixmap as active if we upload into it
Be more strict with when we mark the pixmap as active so that we only
wait for the actual XCopyArea involving the pixmap to complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 10:32:25 +00:00
Chris Wilson
45a4b42a36 script: Recompress strings using LZO whilst binding traces
Try using the lighter-weight LZO decompressor in an effort to speed up
replays (at the cost of making the bound traces slightly larger).
Presuming that with the slight increase in file size (from -1% to +10%),
the file data remains in the readahead buffer cache, replays see a
performance improvement of between 5-10%.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 21:10:35 +00:00
Martin Robinson
9194904fa8 gl: Better handling of clear surfaces
When clearing a GL surface, set is_clear to true, and when mapping to an
image, handle is_clear like surfaces without modification. Additionally,
explicitly clear surfaces created via cairo_surface_create_similar.
2013-01-04 16:31:01 -08:00
Martin Robinson
9bff450844 boilerplate/glx: Add a target with multisampling and stencil support
Add a gl-window target that supports multisampling. This is useful for
testing the MSAA backend on the default framebuffer.
2013-01-04 16:29:51 -08:00
Chris Wilson
8cd604e18a gobject: Fix my typo s/TEST/TEXT/ in the previous commit
Again reported by Kouhei Sutou, who I am grateful for his deligence.
2013-01-04 14:03:40 +00:00
Kouhei Sutou
a4f221498c gobject: Fix "text_cluster_flags_get_type" typo
The macro missed the text from the name, rendering it useless.
2013-01-04 12:18:29 +00:00
Henry Song
9dde964553 gl/msaa: Only clear parts of the stencil buffer we will use
Writing to the stencil buffer can be expensive, so when using the
stencil buffer for clipping only clear the clip extent. When using the
stencil buffer to prevent overlapping rendering during stroking, only
clear the approximate stroke extents.
2013-01-03 16:37:18 -08:00
Alejandro G. Castro
5e9083f882 gl/msaa: Avoid the stencil buffer when possible during masking
In this case we can draw the clip path and avoid the stencil buffer,
which can be expensive.
2013-01-03 16:37:18 -08:00
Henry Song
dd850583a7 gl/msaa: Add full support for masking with the SOURCE operator
Since OpenGL does not have a means to represent a masking SOURCE
operation in one step, we use two steps combined with the ADD
operator.
2013-01-03 15:58:19 -08:00
Chuanbo Weng
c743e93451 gl: Support the GL_IMG_texture_npot extension
This extension, used by older PowerVR drivers, is functionally
equivalent to the GL_OES_TEXTURE_NPOT extension.
2013-01-03 11:40:36 -08:00
Chris Wilson
ae1724ced9 Add missing local slim proto for cairo_recording_surface_create
Dependency introduced in 749ef6be4d

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
872a92b874 scaled-font: Mention ownership of returned object from get_font_face()
As suggested by Simon Sapin.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
734a541dc3 xlib: Avoid copying the source twice if it is an image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Kouhei Sutou
ecc8c28b24 gobject: Add the correct macro name for the hint-metrics type
s/CAIRO_GOBJECT_TYPE_HNT_METRICS/CAIRO_GOBJECT_TYPE_HINT_METRICS/

However, as we have already released the broken headers, we need to
preserve that mistake in case applications are already using. Since it
is just a #define, there is little associated cost with carrying both
the incorrect spelling and the corrected define.
2013-01-03 15:07:18 +00:00
Chris Wilson
5bc1b1f6aa stroke: Make the incremental trapezoid stroker optionally available again
Whilst it cannot handle self-intersecting strokes (which includes the
antialias region of neighbouring lines and joints), it is about 3x
faster to use than the more robust algorithm. As some backends delegate
the rendering, the quality may still be preserved and so they should be
responsible for choosing the appropriate method for generation of the
stroke geometry.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
74941f8220 xlib: Use SHM transport for ordinary image uploads
In theory this should just save a single copy, however PutImage will
break up requests into a series of scanlines requests which is less
efficient than the single-shot transfer provided by ShmPutImage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 12:28:33 +00:00
Chris Wilson
bf2a04c5ab xlib/shm: Fix typo in creation of a SHM image
Pass along the size the caller requests, not the size of the related
drawable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 12:27:34 +00:00
Chris Wilson
c29ab389fb gl: Provide a fast emitter for solid spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:54:26 +00:00
Chris Wilson
d3848521c4 gl: Provide a fast emitter for solid glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:47:02 +00:00
Chris Wilson
127dd46669 gl: Use vfunc for vertex emission
In order to overload the emitters in future to provide specialised
routines for the common types of operands, begin by switching the
current users over to a vfunc interface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:21:11 +00:00
Chris Wilson
9558cb62c6 perf/chart: Contract the default output filenames
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:51:54 +00:00
Chris Wilson
fbd4864995 perf/chart: Show the geometric average as an extra column
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:30:48 +00:00
Chris Wilson
71028865fa Revert "xlib/shm: Do not trigger a surplus event from XShmPutImage"
This reverts commit c97f2d4acd.

Testing suggests that keeping that event is a win; so do so.
2012-12-29 15:05:53 +00:00
Chris Wilson
c97f2d4acd xlib/shm: Do not trigger a surplus event from XShmPutImage
As our lazy event mechanism is sufficient for tracking when to reuse shm
memory, and the events are not necessary for ShmPut/ShmGetImage paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 14:56:24 +00:00