summaryrefslogtreecommitdiff
path: root/src/cairo-surface-subsurface-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-30 17:28:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-12 08:29:48 +0100
commitaf9fbd176b145f042408ef5391eef2a51d7531f8 (patch)
tree5f75d1087d4325a013af6f0a4204a666fb4ca4f0 /src/cairo-surface-subsurface-private.h
parent0540bf384aed344899417d3b0313bd6704679c1c (diff)
downloadcairo-af9fbd176b145f042408ef5391eef2a51d7531f8.tar.gz
Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
Diffstat (limited to 'src/cairo-surface-subsurface-private.h')
-rw-r--r--src/cairo-surface-subsurface-private.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/cairo-surface-subsurface-private.h b/src/cairo-surface-subsurface-private.h
index ada09a171..6a43c8fa1 100644
--- a/src/cairo-surface-subsurface-private.h
+++ b/src/cairo-surface-subsurface-private.h
@@ -36,9 +36,8 @@
#ifndef CAIRO_SURFACE_SUBSURFACE_PRIVATE_H
#define CAIRO_SURFACE_SUBSURFACE_PRIVATE_H
-#include "cairoint.h" /* for cairo_surface_backend_t */
-
#include "cairo-surface-private.h"
+#include "cairo-surface-backend-private.h"
struct _cairo_surface_subsurface {
cairo_surface_t base;
@@ -54,6 +53,25 @@ _cairo_surface_subsurface_get_target (cairo_surface_t *surface)
return ((cairo_surface_subsurface_t *) surface)->target;
}
+static inline void
+_cairo_surface_subsurface_offset (cairo_surface_t *surface,
+ int *x, int *y)
+{
+ cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface;
+ *x += ss->extents.x;
+ *y += ss->extents.y;
+}
+
+static inline cairo_surface_t *
+_cairo_surface_subsurface_get_target_with_offset (cairo_surface_t *surface,
+ int *x, int *y)
+{
+ cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface;
+ *x += ss->extents.x;
+ *y += ss->extents.y;
+ return ss->target;
+}
+
static inline cairo_bool_t
_cairo_surface_is_subsurface (cairo_surface_t *surface)
{