summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-08-26 12:54:25 +0200
committerBenjamin Otte <otte@redhat.com>2010-08-26 12:55:39 +0200
commite79acf47a57b60c83d1f9491aac354161986b29b (patch)
treef0a83e3aafea9cba1127f1f0021c350544af4e63
parent40459dacb52587cc784faf2635e54797d3989408 (diff)
subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE public
-rw-r--r--src/cairo-analysis-surface.c2
-rw-r--r--src/cairo-image-surface.c2
-rw-r--r--src/cairo-pdf-surface.c4
-rw-r--r--src/cairo-ps-surface.c4
-rw-r--r--src/cairo-script-surface.c2
-rw-r--r--src/cairo-surface-subsurface.c4
-rw-r--r--src/cairo-types-private.h3
-rw-r--r--src/cairo-xcb-surface-render.c4
-rw-r--r--src/cairo-xlib-surface.c2
-rw-r--r--src/cairo.h7
-rw-r--r--src/drm/cairo-drm-i915-shader.c6
-rw-r--r--src/drm/cairo-drm-i965-shader.c6
12 files changed, 25 insertions, 21 deletions
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 5d554aa72..a61514903 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -118,7 +118,7 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
surface->has_ctm = ! _cairo_matrix_is_identity (&surface->ctm);
source = surface_pattern->surface;
- if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
source = sub->target;
}
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 464df323e..f88ccb88d 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1410,7 +1410,7 @@ _pixman_image_for_surface (const cairo_surface_pattern_t *pattern,
source->stride);
if (unlikely (pixman_image == NULL))
return NULL;
- } else if (type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ } else if (type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub;
cairo_bool_t is_contained = FALSE;
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 2da49d941..c60e6360f 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1080,7 +1080,7 @@ _get_source_surface_size (cairo_surface_t *source,
unsigned long mime_data_length;
if (source->type == CAIRO_SURFACE_TYPE_RECORDING) {
- if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
*width = sub->extents.width;
@@ -2343,7 +2343,7 @@ _cairo_pdf_surface_emit_surface (cairo_pdf_surface_t *surface,
cairo_pdf_source_surface_t *src_surface)
{
if (src_surface->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
- if (src_surface->surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (src_surface->surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) src_surface->surface;
return _cairo_pdf_surface_emit_recording_subsurface (surface,
sub->target,
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index bedc143fd..c73214e00 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2620,7 +2620,7 @@ _cairo_ps_surface_acquire_surface (cairo_ps_surface_t *surface,
surface->image = NULL;
if (pattern->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
- if (pattern->surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (pattern->surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) pattern->surface;
*width = sub->extents.width;
@@ -2710,7 +2710,7 @@ _cairo_ps_surface_emit_surface (cairo_ps_surface_t *surface,
if (pattern->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
cairo_surface_t *source = pattern->surface;
- if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
status = _cairo_ps_surface_emit_recording_subsurface (surface, sub->target, &sub->extents);
} else {
diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c
index f0db3b0aa..0f0446d6a 100644
--- a/src/cairo-script-surface.c
+++ b/src/cairo-script-surface.c
@@ -1429,7 +1429,7 @@ _emit_surface_pattern (cairo_script_surface_t *surface,
case CAIRO_SURFACE_TYPE_SCRIPT:
status = _emit_script_surface_pattern (surface, (cairo_script_surface_t *) source);
break;
- case CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE:
+ case CAIRO_SURFACE_TYPE_SUBSURFACE:
status = _emit_subsurface_pattern (surface, (cairo_surface_subsurface_t *) source);
break;
default:
diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index 579a6e414..36bd9fbe2 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -428,7 +428,7 @@ _cairo_surface_subsurface_snapshot (void *abstract_surface)
}
static const cairo_surface_backend_t _cairo_surface_subsurface_backend = {
- CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE,
+ CAIRO_SURFACE_TYPE_SUBSURFACE,
_cairo_surface_subsurface_create_similar,
_cairo_surface_subsurface_finish,
@@ -520,7 +520,7 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
if (_cairo_surface_get_extents (target, &target_extents))
ret = _cairo_rectangle_intersect (&surface->extents, &target_extents);
- if (target->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (target->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
/* Maintain subsurfaces as 1-depth */
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) target;
surface->extents.x += sub->extents.x;
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index d042736cd..ac3fda82e 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -223,8 +223,7 @@ typedef enum _cairo_int_status {
} cairo_int_status_t;
typedef enum _cairo_internal_surface_type {
- CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE = 0x1000,
- CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT,
+ CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT = 0x1000,
CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 6e6255eda..8294a4728 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -1186,7 +1186,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
if (unlikely (picture->base.status))
return picture;
}
- } else if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ } else if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
cairo_xcb_surface_t *xcb = (cairo_xcb_surface_t *) sub->target;
@@ -1233,7 +1233,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
if (unlikely (picture->base.status))
return picture;
}
- } else if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ } else if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
cairo_xcb_surface_t *xcb = ((cairo_xlib_xcb_surface_t *) sub->target)->xcb;
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 350331d1e..c74f656bf 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2342,7 +2342,7 @@ _cairo_xlib_surface_upload(cairo_xlib_surface_t *surface,
extents.x = extents.y = 0;
extents.width = image->width;
extents.height = image->height;
- } else if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ } else if (image->base.backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) image;
image = (cairo_image_surface_t *) sub->target;
src_x += sub->extents.x;
diff --git a/src/cairo.h b/src/cairo.h
index bc698a28b..fd95c4d04 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -1963,6 +1963,8 @@ cairo_device_reference (cairo_device_t *device);
* @CAIRO_DEVICE_TYPE_DRM: The surface is of type Direct Render Manager
* @CAIRO_DEVICE_TYPE_XML: The surface is of type XML
* @CAIRO_DEVICE_TYPE_SKIA: The surface is of type Skia
+ * @CAIRO_DEVICE_TYPE_SUBSURFACE: The surface is a subsurface created with
+ * cairo_surface_create_for_rectangle()
*
* #cairo_device_type_t is used to describe the type of a given
* device. The devices types are also known as "backends" within cairo.
@@ -2100,6 +2102,8 @@ cairo_surface_status (cairo_surface_t *surface);
* @CAIRO_SURFACE_TYPE_TEE: The surface is of type 'tee' (a multiplexing surface), since 1.10
* @CAIRO_SURFACE_TYPE_XML: The surface is of type XML (for debugging), since 1.10
* @CAIRO_SURFACE_TYPE_SKIA: The surface is of type Skia, since 1.10
+ * @CAIRO_SURFACE_TYPE_SUBSURFACE: The surface is a subsurface created with
+ * cairo_surface_create_for_rectangle(), since 1.10
*
* #cairo_surface_type_t is used to describe the type of a given
* surface. The surface types are also known as "backends" or "surface
@@ -2147,7 +2151,8 @@ typedef enum _cairo_surface_type {
CAIRO_SURFACE_TYPE_DRM,
CAIRO_SURFACE_TYPE_TEE,
CAIRO_SURFACE_TYPE_XML,
- CAIRO_SURFACE_TYPE_SKIA
+ CAIRO_SURFACE_TYPE_SKIA,
+ CAIRO_SURFACE_TYPE_SUBSURFACE
} cairo_surface_type_t;
cairo_public cairo_surface_type_t
diff --git a/src/drm/cairo-drm-i915-shader.c b/src/drm/cairo-drm-i915-shader.c
index 4ded89ebb..483f1874f 100644
--- a/src/drm/cairo-drm-i915-shader.c
+++ b/src/drm/cairo-drm-i915-shader.c
@@ -1537,7 +1537,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
if (surface->type == CAIRO_SURFACE_TYPE_XCB) {
cairo_surface_t *xcb = surface;
- if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (xcb->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
xcb = ((cairo_surface_subsurface_t *) surface)->target;
} else if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
xcb = ((cairo_surface_snapshot_t *) surface)->target;
@@ -1553,7 +1553,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
#endif
if (surface->type == CAIRO_SURFACE_TYPE_DRM) {
- if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
drm = ((cairo_surface_subsurface_t *) surface)->target;
} else if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
drm = ((cairo_surface_snapshot_t *) surface)->target;
@@ -1563,7 +1563,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
if (drm->type == CAIRO_SURFACE_TYPE_DRM) {
i915_surface_t *s = (i915_surface_t *) drm;
- if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
if (s->intel.drm.base.device == shader->target->intel.drm.base.device &&
s != shader->target)
{
diff --git a/src/drm/cairo-drm-i965-shader.c b/src/drm/cairo-drm-i965-shader.c
index 515b4a63f..5a5c966e9 100644
--- a/src/drm/cairo-drm-i965-shader.c
+++ b/src/drm/cairo-drm-i965-shader.c
@@ -402,7 +402,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
if (surface->type == CAIRO_SURFACE_TYPE_XCB) {
cairo_surface_t *xcb = surface;
- if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (xcb->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
xcb = ((cairo_surface_subsurface_t *) surface)->target;
} else if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
xcb = ((cairo_surface_snapshot_t *) surface)->target;
@@ -418,7 +418,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
#endif
if (surface->type == CAIRO_SURFACE_TYPE_DRM) {
- if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
drm = ((cairo_surface_subsurface_t *) surface)->target;
} else if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
drm = ((cairo_surface_snapshot_t *) surface)->target;
@@ -430,7 +430,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
if (drm->type == CAIRO_SURFACE_TYPE_DRM) {
i965_surface_t *s = (i965_surface_t *) drm;
- if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
+ if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
if (s->intel.drm.base.device == shader->target->intel.drm.base.device) {
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) surface;
if (s != shader->target) {