[cairo-commit] src/cairo-analysis-surface.c src/cairo.h src/cairo-image-surface.c src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-script-surface.c src/cairo-surface-subsurface.c src/cairo-types-private.h src/cairo-xcb-surface-render.c src/cairo-xlib-surface.c src/drm

Benjamin Otte company at kemper.freedesktop.org
Thu Aug 26 03:55:48 PDT 2010


 src/cairo-analysis-surface.c    |    2 +-
 src/cairo-image-surface.c       |    2 +-
 src/cairo-pdf-surface.c         |    4 ++--
 src/cairo-ps-surface.c          |    4 ++--
 src/cairo-script-surface.c      |    2 +-
 src/cairo-surface-subsurface.c  |    4 ++--
 src/cairo-types-private.h       |    3 +--
 src/cairo-xcb-surface-render.c  |    4 ++--
 src/cairo-xlib-surface.c        |    2 +-
 src/cairo.h                     |    7 ++++++-
 src/drm/cairo-drm-i915-shader.c |    6 +++---
 src/drm/cairo-drm-i965-shader.c |    6 +++---
 12 files changed, 25 insertions(+), 21 deletions(-)

New commits:
commit e79acf47a57b60c83d1f9491aac354161986b29b
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Aug 26 12:54:25 2010 +0200

    subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE public

diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 5d554aa..a615149 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 464df32..f88ccb8 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 2da49d9..c60e636 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 bedc143..c73214e 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 f0db3b0..0f0446d 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 579a6e4..36bd9fb 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 d042736..ac3fda8 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 6e6255e..8294a47 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 350331d..c74f656 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 bc698a2..fd95c4d 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 4ded89e..483f187 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 515b4a6..5a5c966 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) {


More information about the cairo-commit mailing list