mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 17:18:42 +02:00
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>
This commit is contained in:
parent
146da77d85
commit
e1307da861
1 changed files with 14 additions and 5 deletions
|
|
@ -5356,11 +5356,20 @@ _set_source_image (csi_t *ctx)
|
|||
* principally to remove the pixman ops from the profiles.
|
||||
*/
|
||||
if (_csi_likely (_matching_images (surface, source))) {
|
||||
cairo_surface_flush (surface);
|
||||
memcpy (cairo_image_surface_get_data (surface),
|
||||
cairo_image_surface_get_data (source),
|
||||
cairo_image_surface_get_height (source) * cairo_image_surface_get_stride (source));
|
||||
cairo_surface_mark_dirty (surface);
|
||||
if (cairo_surface_get_reference_count (surface) == 1 &&
|
||||
cairo_surface_get_reference_count (source) == 1)
|
||||
{
|
||||
_csi_peek_ostack (ctx, 0)->datum.surface = surface;
|
||||
_csi_peek_ostack (ctx, 1)->datum.surface = source;
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_surface_flush (surface);
|
||||
memcpy (cairo_image_surface_get_data (surface),
|
||||
cairo_image_surface_get_data (source),
|
||||
cairo_image_surface_get_height (source) * cairo_image_surface_get_stride (source));
|
||||
cairo_surface_mark_dirty (surface);
|
||||
}
|
||||
} else {
|
||||
cairo_t *cr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue