As _cairo_surface_get_source() returns the limits of the source, a chunk
of code to query the source extents became redundant.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the midst of trying to simply export the
_cairo_image_surface_get_font_options() for subclassing, I accidentally
decoupled it from the image surface backend. Mea culpa.
Fixes regression from 8bea52bb (Add preliminary damage tracking), which
should not have even touched the backend structure except for an ugly
rebasing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
and make it more obvious that we're not doing OOB accesses.
They were not possible because of the parity constraint, but by
guarding the highest index with which we access the data in the loop,
the correctness information is completely contained in the loop code.
Fixes:
cairo-stroke-style.c:199:2: warning: cannot optimize loop, the loop
counter may overflow [-Wunsafe-loop-optimizations]
_cairo_path_fixed_last_op() contains an assertion, which gcc doesn't
like to inline. Since it is a static function, which basically
accesses a value, gcc will inline it anyway when assertions are
disabled, so remove the "inline" hint to reduce gcc warning noise when
doing debug builds.
Fixes:
cairo-path-fixed.c: In function '_cairo_path_fixed_drop_line_to':
cairo-path-fixed.c:373:1: warning: inlining failed in call to
'_cairo_path_fixed_last_op.isra.5.part.6': call is unlikely and code
size would grow [-Winline]
cairo-path-fixed.c:400:1: warning: called from here [-Winline]
...
As we return the child image to the user and so perform the reference
tracking on it and not the parent win32 display surface, we need to add
a call to destroy the parent from the image surface. This of course
complicates the normal scenario of destroying the parent first, and so
in that case we need to unhook the image->parent before freeing the
surface->image.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
I suspect I may split the win32 code into a few more files, so move it
to its own directory to reduce the clutter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This is initially based around the requirements for handling internal
fallbacks to the image compositor and reducing the number of pixels
required to be transferred.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The pattern creation function call in the example code has one _mesh too
much. This hopefully fixes the mesh mismatch mess :)
Signed-off-by: Nis Martensen <nis.martensen@web.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Update to latest surface backend structure, removed obsolete functions
and fixed functions API in order to be compatible with backend definition.
Fixed compilation with Qt5
GCC complains that:
cairo-surface-observer.c:289:26: warning: ignoring return value of
'cairo_device_acquire', declared with attribute warn_unused_result
[-Wunused-result]
Explain why it's safe to ignore it in a comment.
Making cairo_surface_observer_print() and
cairo_device_observer_print() return the status of the observer or of
the stream makes it possible to correctly track what kind of error
happens if the print is not successful.
This makes the functions more consistent with existing API with a
similar signature like cairo_surface_write_to_png_stream().
If a bounded recording surface doesn't have its extents .x and .y at the
surface's origin, this code was translating all clips to make up for that.
However, the clip already is in device space.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41583
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Rather than the operation extents which may be larger. It would be
beneficial to trim to the intersection instead and tweak the pattern
matrices - however this is the fallback path and so hopefully less
frequently trod!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When checking for continuations on the right-hand edge, the actual
direction of the edge is immaterial as it is sorted into ascending
y-order and the direction is fixed up when emitting into the output
polygon.
Fixes assertion introduced with 658fa75a5c.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Only bail if we need to combine clipping with the spans (either for a
bounded or unbounded operation).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we steal the boxes, we leave behind an extents-only clip, i.e. only
without a path or boxes, in which case do not return FALSE for the
is-contained check on a rectangle.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
By simply swapping the continuation edges, we end up with a set of edges
that are defined over a shorter range than their extents. Whilst this is
numerically stable at our normal precision we start to encounter issues
when using a coarser grid during rasterisation as the derivative of the
edge becomes unstable.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44722
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Rewrite the directfb backend as nothing more than a simpler image
compositor onto a shadowfb that is flushed back to the dfb surface as
required. Future refinements would be to add damage tracking, and to mix
the useful directfb operations (such as solid fills and alpha blends).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Replace the assertion that the context is flushed when we destroy the
operation and jfdi. Easiest way to resolve it rather than untangle just
why we end up there with an unflushed context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When painting a GL surface pattern from one context to a
a surface of another context, be careful to manage the
multiple contexts so that they do not stomp on each other.
[ickle: Preserve fast path for GL subsurfaces]
Printing to a printer with an Adobe PostScript 3 interpreter fails
with rangecheck when the shading domain is not [ 0 1 ]. Workaround
this by using a type 3 function to map from [ 0 1] to the required
domain.
For a foreign drawable, we have to assume to that is dirty upon creation
or otherwise we fail to read back the correct pixel data when copying to
an image.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>