Age | Commit message (Collapse) | Author | Files | Lines |
|
When using WinAnsiEncoding in PDF the glyphs are keyed by glyph
name. We need to ensure the correct names are used and can't assume
the glyph names in the font are correct.
Bug 60248
|
|
In normal cases, we want to flush pending operations reading from the
texture before modifying its contents. However during uploading of
glyphs into the glyph cache, we repeatedly modify the texture as we
construct the vbo (whilst referencing it for that operation). We track
unused areas in the glyph cache so that if we run out of space, we can
explicitly flush the pending glyphs and start afresh and avoid having to
flush the operation in common case.
|
|
As we may specialise the vertex program depending upon details of the
fragment shader, and may have more than one program for the same
combination of fragment sources, we need to include the vertex tag in
the cache entry.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Not only is our point transformation code is quite slow (well at least
compared to a real GPU), but by deriving the texture coordinates from
the vertex position we can elide the multiple arrays that we need to
construct and pass to GL - improving performance by eliminating CPU
overhead from needless transforms and data shovelling.
However, not all vertex emission is suitable. For instance, for glyphs
we need to emit discontiguous texture coordinates for each glyph, but
span generation is suitable - which fortuitously also has the largest
vertex density and so benefits the most.
The only real concern is for hardware without true vertex shader support
(e.g. i915) but there we are already invoking the VS to transform the
vertex into the viewport. We would need to eliminate that transform as
well as manually compute the texture coordinates in order to eliminate
the vertex recomputation pass.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We now need to explicitly manage fallbacks and to provide an
implementation for map-to-image/unmap-image.
|
|
In a similar fashion to the previous commit, we also need to be wary of
users simply trying to read from a potentially freed user-data array.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As we cleanup the user-data arrays, we call the user provided destroy
notifier callbacks. These callbacks are at liberty to write back into
the parent surface, and in particular try to write into the arrays that
we have just freed. This causes hard to control and fairly unpredictable
use-after-frees in the client, so lets just rule out the dangerous
behaviour.
References:https://bugzilla.mozilla.org/show_bug.cgi?id=722975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The GL backend would like to extract a rectangle from another surface
and convert it to a different pixel format. The
_cairo_image_surface_create_from_image() does that by returning a new
image that has the contents of the specified rectangle in the source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We use the parent as a flag during map-to-image/umap-image that the
resultant image came from a fallback rather than as direct call
to the backend's map_to_image(). Whilst we use it as a simple flag,
we need to make sure the parent surface obeys the reference counting
semantics and is consistent for all callers.
Unlike other users of the parent pointer, there is no resource sharing
between the two surfaces.
Reported-by: Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Everytime I read the predicate wrong, but hopefully, this time I have it
right!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Rename the seqno tests into seqno_passed(), seqno_before() and
seqno_after() in order to clarify their semantics.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The color attribute is disabled when not in spans mode, so the emitted
alpha is simply overwritten by the next vertex. Additionally, this can
potentially cause the alpha to be written past the end of the buffer.
|
|
Initialise shm during its declaration so that it is indeed initialised
for the cleanup after every path.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Make sure that we simply copy from the SHM segment into the target
drawable, and not inadvertently stage it through another SHM buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The scratch image buffers are used for uploads to the xserver and so we
must be careful not to overwrite active SHM segments. Unfortunately we
told the core SHM allocator that we would sync before using the images,
which was a lie.
Reported-by: Michael Natterer <mitch@gimp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
...and treat is as an expected event for synchronisation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the image is already inside a SHM segment, but the image format does
not match the surface, fallback to the XRender paths in order to perform
colorspace conversion on the data already inside the Xserver.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Along the draw_image_boxes() upload path, we were actually marking the
ShmPixmap as still active for the subsequent drawing operation - which
could in theory never be submitted...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
I should have realised the previous result was too good to be true!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
On a SNB i5-2500:
Speedups
========
firefox-chalkboard 34284.16 -> 19637.40: 1.74x speedup
swfdec-giant-steps 778.35 -> 665.37: 1.17x speedup
ocitysmap 485.64 -> 431.94: 1.12x speedup
Slowdowns
=========
firefox-fishbowl 46878.98 -> 54407.14: 1.16x slowdown
That slow down is due to overhead of the increased number of calls to
pixman_image_composite32() (pixman_transform_point for analyzing the
source extents in particular) outweighing any advantage gained by
performing the rasterisation in a single pass and eliding gaps. The
solution that has been floated in the past is for an interface into
pixman to only perform the analysis once and then to return a kernel to
use for all spans.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Instead of invoking Bentley-Ottman for fills that are simple
quadrilaterals, just pass the geometry straight to OpenGL.
|
|
It's safe to us GL_ALPHA for glyph caching surfaces, since Cairo only
uses them for texture uploading. This saves a little bit of memory.
|
|
Instead of looking for the EXT_framebuffer_multisample, this code should
look for GL_EXT_framebuffer_multisample. GL_ARB_framebuffer_object also
contains all necessary API for using multisampling, so we don't need to
check for both it and the GL_EXT_framebuffer_blit and
GL_EXT_framebuffer_multisample pair.
|
|
We need to clean up the polygon we create when decomposing a path into
trapezoids.
|
|
If display has changed, the associated context must change. A
context is tied a display so we can avoid this check, eliminating
unnecessary work during context acquisition and release.
|
|
Fixes regression exposed by
commit a73e7ff0186176bc82cd3ae1432c054c1fd3aebd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Jan 6 11:29:27 2013 +0000
xlib: Simplify source creation by use of map-to-image
but ultimately from
commit 74941f822015cc50cd8477d0cf97f1a70dbff60b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Jan 2 22:27:55 2013 +0000
xlib: Use SHM transport for ordinary image uploads
Reported-by: Gökçen Eraslan <gokcen.eraslan@gmail.com>
Reported-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
Reported-by: Emmanuel Benisty <benisty.e@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59635
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Handle "fake" surfaces created by _cairo_gl_pattern_to_source which just
embed a GL backend operand. These surfaces do not have a backend, so we
should not fall back if a surface without a backend is not a texture
surface.
|
|
If a GL surface is not a texture and is used as source or mask,
fall back to using an image surface as an intermediary.
Fixes subsurface-image-repeat, subsurface-modify-child,
subsurface-modify-parent, subsurface-outside-target, subsurface-pad,
subsurface-reflect, subsurface-repeat, and subsurface-scale.
|
|
The MSAA compositor is implicitly relying on the existence of several
OpenGL extensions. This change makes those dependencies explicit.
|
|
So that we do not try to tell X to free a garbage pixmap and promptly
kill us.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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.
|
|
After 5e9083f882859201c5df18fc870577a224f88cbb 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.
|
|
So we can drop ours.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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.
|
|
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>
|
|
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>
|
|
_cairo_damage_destroy() does not like to be passed a NULL.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|