summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-16 08:38:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-16 09:00:16 +0100
commited94d7caad6b851f6f80fa4d67441ad0387a8cd4 (patch)
treeb716e11e5b61df213d30f63240e46dfa1efb94a4
parentc739940137c4ffc6cc727ea30afc0e92f7ab1e80 (diff)
[fallback] Create intermediate surface with same content.
The goal is to create a similar surface with an identical format to maximise performance in the subsequent blit, e.g. the xlib backend could make the similar surface with an identical depth and so use the core protocol, or the image surface could indeed make an identical copy so that pixman only has to do a fast memcpy. As there is no direct method to specify such a clone, we ask the backend for a similar surface of identical content, and trust that the semantics are clear enough for the intent to obvious.
-rw-r--r--src/cairo-surface-fallback.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 068f06dc..f1453b8a 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -227,17 +227,19 @@ _clip_and_composite_combine (cairo_clip_t *clip,
cairo_status_t status;
/* We'd be better off here creating a surface identical in format
- * to dst, but we have no way of getting that information.
- * A CAIRO_CONTENT_CLONE or something might be useful.
+ * to dst, but we have no way of getting that information. Instead
+ * we ask the backend to create a similar surface of identical content,
+ * in the belief that the backend will do something useful - like use
+ * an identical format. For example, the xlib backend will endeavor to
+ * use a compatible depth to enable core protocol routines.
*/
intermediate =
- _cairo_surface_create_similar_scratch (dst,
- CAIRO_CONTENT_COLOR_ALPHA,
+ _cairo_surface_create_similar_scratch (dst, dst->content,
extents->width,
extents->height);
if (intermediate == NULL) {
intermediate =
- _cairo_image_surface_create_with_content (CAIRO_CONTENT_COLOR_ALPHA,
+ _cairo_image_surface_create_with_content (dst->content,
extents->width,
extents->width);
}