The GL version string returned by glGetString() for GLES doesn't have the
version number at the beginning of the string.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Søren Sandmann Pedersen spotted that we had reversed the channel order
in the conversion back from the pixman format codes to
CAIRO_FORMAT_RGB30.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This is a common format used by framebuffers to drive 10bpc displays
and is often hardware accelerated by XRender with underlying support
from pixman's x2r10g10b10 format (which provides coercion paths for
fallbacks).
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The check-doc-syntax step of 'make check' reports:
./cairo-gl.h: * cairo_device_t, which represents an GL context created by the user.
Error: some function names in the docs are not followed by parentheses.
Fix this by searching for the following regexp in the above files:
'^[^:]*:[/ ][*]\(\|[ ].*\)\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'
gcc complains that
cairo-surface-wrapper.c:647: warning: ignoring return value of
‘_cairo_rectangle_intersect’, declared with attribute warn_unused_result
It can be silenced by making _cairo_rectangle_intersect()
cairo_private_no_warn. This makes it possible to avoid unused
temporary variables in other places and reduces the dead assignments
reported by clang static analyzer from 114 to 98.
gcc does not know thta num_glyph is guaranteed to be strictly
positive, so it complains that:
cairo-image-surface.c:3787: warning: ‘status’ may be used uninitialized in this function
Unify the _cairo_rectangle_list_create_in_error() functions, keeping
the best features from both (the one in cairo-clip.c statically
allocates the most common cases, the one in cairo.c throws a NO_MEMORY
error when it cannot malloc() instead of rethrowing the same error).
The same function can be used to return an error-list in
_cairo_gstate_copy_clip_rectangle_list() when _cairo_clip_rectangle()
fails (for example becaouse of an OOM).
cairo_set_font_size() should be equivalent to setting the font matrix
to an appropriate scale matrix.
Implementing it this way saves some code and makes sure that the same
code path is used whenever the font matrix is changed.
3-sided boxes can be replaced with rectangles when clipping and
filling, but not when stroking. _emit_path() is used for all of these
operations, so it cannot perform the optimization except for 4-sided
boxes.
Fixes stroke-open-box.
__cairo_path_fixed_is_rectangle() is used by the PS and PDF backends
to check if a path is equivalent to a rectangle when stroking. This is
different from being a rectangle when filling, because of the implicit
close_path appended to every subpath when filling.
Fixes stroke-open-box.
See https://bugs.freedesktop.org/show_bug.cgi?id=34560
The RENDER specification requires radial gradients to have the first
circle completely inside the second one, but the error is not actually
generated.
The implementation produces the expected results if either circle
contains the other one, so only fall back in these cases.
The RENDER specification does not specify the constraints on the
gradient stops, but its implementation returns an error if less than 2
stops are used.
Xlib and XCB can work around this because gradients with just one stop
are by-definition the same as gradients with that stop repeated twice.
Fixes radial-gradient-one-stop.
All cairo_xcb_picture_t now get their own, private Picture instead of possibly
sharing it with a cairo_xcb_surface_t.
This solves a cyclic dependency which caused cairo_xcb_picture_t to be leaked
until their device was finished.
When an xcb surface was used as a source, a cairo_xcb_picture_t was created
which kept a reference to the surface. This picture was then added as a snapshot
to the surface which caused the surface to own a reference to the picture.
As a result, the Picture and possibly its associated Pixmap were not freed on
the X11 server which could thus run out of memory.
This change causes more Pictures to be created which could possibly slow down
cairo-xcb. There seems to be no measurable difference with cairo-perf-trace. For
the micro benchmarks, this has the most impact on paint_similar-rgba_source.512:
min(ticks) min(ms) median(ms) stddev. iterations overhead
before 158732 0.159 0.159 0.11% 4: 1651.49
after 162579 0.163 0.163 0.18% 4: 1612.41
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34912
Signed-off-by: Uli Schlachter <psychon@znc.in>
This flag was only ever tested, but never set. Also, there is no X11 server out
there which actually supports this.
AFAIK it was just an experiment which turned into dead code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
RENDER 0.11 added PDF operators and the cairo-xcb backend is already prepared
for handling them. However, it doesn't actually handle them.
If you used such an operator with RENDER 0.11, _operator_is_supported() would
return TRUE, but later on an ASSERT_NOT_REACHED in _render_operator() is hit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
All of these defines where not used anymore and this '#if 0'd code was so for
ages and most likely would stay commented out for more ages, too.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We never bound any other value to the sampler uniforms, so why bother
resetting them all the time?
[ 0] before firefox-talos-gfx 29.972 30.493 0.89% 3/3
[ 0] after firefox-talos-gfx 29.397 29.599 1.27% 3/3
Signed-off-by: Eric Anholt <eric@anholt.net>
Because of GLX's unfortunate requirement that only one context have a
thread current at a time, we had to unbind the context, triggering a
flush, and eating of all the CPU. With a small tweak to the GLX spec
by GLX_MESA_multithread_makecurrent, and a small tweak to Mesa that
consisted mostly of deleting the "is this thread already bound
elsewhere?" check, we can bind our context to any thread and use it
safely as long as our usage of it is mutexed, which cairo-gl should
already be doing.
[ 0] before firefox-talos-gfx 50.260 50.525 0.25% 3/3
[ 0] after firefox-talos-gfx 32.091 32.422 0.65% 3/3
Since its inception, cairo-gl has been plagued by the "how am I really
supposed to use it?" problem. This lays down my expectations for how
cairo-gl will interact with other usage of the GL API.
If PIXMAN_HAS_ATOMIC_OPS, ix and iy will be changed if the source
surface is of subsurface type. They need to be reset to 0 before being
passed to _cairo_matrix_to_pixman_matrix_offset() or the acquired
surface will have an incorrect offset .
The pixman_image_ref() and pixman_image_unref() functions
aren't threadsafe in current pixman, so we can't share
pixman images across contexts where they may end up
moving between threads. The main use of these functions
is in keeping a global cache of pixman_image_ts for
solid colours and reusing the same pixman_image_t for
patterns pointing to the same image data where possible.
This patch removes those uses from cairo by wrapping
them in a PIXMAN_HAS_ATOMIC_OPS conditional. There is
no automatic test this, so we will have to manually
turn this code back on when pixman does gain atomic
ops.
The only two remaining calls to pixman_image_ref() are
done on locally created images so they are safe.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34177