Commit 161836ab authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

ps: unwrap recording surface snapshots


Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent b8f09f08
......@@ -67,6 +67,7 @@
#include "cairo-paginated-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-surface-clipper-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-output-stream-private.h"
#include "cairo-type3-glyph-surface-private.h"
......@@ -2541,6 +2542,9 @@ _cairo_ps_surface_emit_recording_surface (cairo_ps_surface_t *surface,
old_page_bbox = surface->page_bbox;
old_cairo_to_ps = surface->cairo_to_ps;
if (_cairo_surface_is_snapshot (recording_surface))
recording_surface = _cairo_surface_snapshot_get_target (recording_surface);
status =
_cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) recording_surface,
&bbox,
......@@ -2640,6 +2644,9 @@ _cairo_ps_surface_emit_recording_subsurface (cairo_ps_surface_t *surface,
&surface->cairo_to_ps);
_cairo_output_stream_printf (surface->stream, " q\n");
if (_cairo_surface_is_snapshot (recording_surface))
recording_surface = _cairo_surface_snapshot_get_target (recording_surface);
if (recording_surface->content == CAIRO_CONTENT_COLOR) {
surface->content = CAIRO_CONTENT_COLOR;
_cairo_output_stream_printf (surface->stream,
......@@ -2743,10 +2750,15 @@ _cairo_ps_surface_acquire_surface (cairo_ps_surface_t *surface,
*width = sub->extents.width;
*height = sub->extents.height;
} else {
cairo_recording_surface_t *recording_surface = (cairo_recording_surface_t *) pattern->surface;
cairo_recording_surface_t *recording_surface;
cairo_box_t bbox;
cairo_rectangle_int_t extents;
recording_surface = (cairo_recording_surface_t *) pattern->surface;
if (_cairo_surface_is_snapshot (&recording_surface->base))
recording_surface = (cairo_recording_surface_t *)
_cairo_surface_snapshot_get_target (&recording_surface->base);
status = _cairo_recording_surface_get_bbox (recording_surface, &bbox, NULL);
if (unlikely (status))
return status;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment