[cairo-commit] 2 commits - src/cairoint.h src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-quartz-image-surface.c src/cairo-surface.c src/cairo-svg-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 1 10:19:19 PDT 2012


 src/cairo-pdf-surface.c          |   13 ++++++-------
 src/cairo-ps-surface.c           |    6 +++---
 src/cairo-quartz-image-surface.c |    4 ++--
 src/cairo-surface.c              |    2 --
 src/cairo-svg-surface.c          |    2 +-
 src/cairoint.h                   |    2 --
 6 files changed, 12 insertions(+), 17 deletions(-)

New commits:
commit f1b546b1a2b3c4a87ca00ce0d6fa6ce88c84d20c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 1 17:46:25 2012 +0100

    Erradicate internal use of cairo_surface_get_type()
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 17a07d1..9765179 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -52,7 +52,7 @@
 #include "cairo-composite-rectangles-private.h"
 #include "cairo-default-context-private.h"
 #include "cairo-error-private.h"
-#include "cairo-image-surface-private.h"
+#include "cairo-image-surface-inline.h"
 #include "cairo-image-info-private.h"
 #include "cairo-recording-surface-private.h"
 #include "cairo-output-stream-private.h"
@@ -1130,7 +1130,7 @@ _cairo_pdf_surface_acquire_source_image_from_pattern (cairo_pdf_surface_t
 	surf = _cairo_raster_source_pattern_acquire (pattern, &surface->base, NULL);
 	if (!surf)
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
-	assert (cairo_surface_get_type (surf) == CAIRO_SURFACE_TYPE_IMAGE);
+	assert (_cairo_surface_is_image (surf));
 	*image = (cairo_image_surface_t *) surf;
     } break;
 
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 8f8e34f..877ba14 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -66,7 +66,7 @@
 #include "cairo-composite-rectangles-private.h"
 #include "cairo-default-context-private.h"
 #include "cairo-error-private.h"
-#include "cairo-image-surface-private.h"
+#include "cairo-image-surface-inline.h"
 #include "cairo-list-inline.h"
 #include "cairo-scaled-font-subsets-private.h"
 #include "cairo-paginated-private.h"
@@ -1738,7 +1738,7 @@ _cairo_ps_surface_acquire_source_surface_from_pattern (cairo_ps_surface_t
 	surf = _cairo_raster_source_pattern_acquire (pattern, &surface->base, &rect);
 	if (!surf)
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
-	assert (cairo_surface_get_type (surf) == CAIRO_SURFACE_TYPE_IMAGE);
+	assert (_cairo_surface_is_image (surf));
 	image = (cairo_image_surface_t *) surf;
     } break;
 
diff --git a/src/cairo-quartz-image-surface.c b/src/cairo-quartz-image-surface.c
index 391ab01..1add952 100644
--- a/src/cairo-quartz-image-surface.c
+++ b/src/cairo-quartz-image-surface.c
@@ -309,7 +309,7 @@ cairo_quartz_image_surface_create (cairo_surface_t *surface)
     if (surface->status)
 	return surface;
 
-    if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_IMAGE)
+    if (! _cairo_surface_is_image (surface))
 	return SURFACE_ERROR_TYPE_MISMATCH;
 
     image_surface = (cairo_image_surface_t*) surface;
@@ -374,7 +374,7 @@ cairo_quartz_image_surface_get_image (cairo_surface_t *asurface)
 {
     cairo_quartz_image_surface_t *surface = (cairo_quartz_image_surface_t*) asurface;
 
-    if (cairo_surface_get_type(asurface) != CAIRO_SURFACE_TYPE_QUARTZ_IMAGE)
+    if (asurface->type != CAIRO_SURFACE_TYPE_QUARTZ_IMAGE)
 	return NULL;
 
     return (cairo_surface_t*) surface->imageSurface;
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 715054c..6ab2140 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -219,7 +219,6 @@ cairo_surface_get_type (cairo_surface_t *surface)
      * surface. */
     return surface->type;
 }
-slim_hidden_def (cairo_surface_get_type);
 
 /**
  * cairo_surface_get_content:
diff --git a/src/cairoint.h b/src/cairoint.h
index 578d6b3..c81d3ef 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1916,7 +1916,6 @@ slim_hidden_proto (cairo_surface_flush);
 slim_hidden_proto (cairo_surface_get_device_offset);
 slim_hidden_proto (cairo_surface_get_font_options);
 slim_hidden_proto (cairo_surface_get_mime_data);
-slim_hidden_proto (cairo_surface_get_type);
 slim_hidden_proto (cairo_surface_has_show_text_glyphs);
 slim_hidden_proto (cairo_surface_mark_dirty);
 slim_hidden_proto (cairo_surface_mark_dirty_rectangle);
commit e23d179e08367dc03c5c8f242bbc3af0749d4920
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 1 17:46:25 2012 +0100

    Erradicate internal use of cairo_surface_get_content()
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index a10c56e..17a07d1 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2134,7 +2134,7 @@ _cairo_pdf_surface_add_padded_image_surface (cairo_pdf_surface_t          *surfa
 	_cairo_fixed_integer_floor(box.p2.y) > w ||
 	_cairo_fixed_integer_floor(box.p2.y) > h)
     {
-	pad_image = _cairo_image_surface_create_with_content (cairo_surface_get_content (&image->base),
+	pad_image = _cairo_image_surface_create_with_content (image->base.content,
 							      rect.width,
 							      rect.height);
 	if (pad_image->status) {
@@ -2345,7 +2345,7 @@ _cairo_pdf_surface_emit_image (cairo_pdf_surface_t     *surface,
 	cairo_surface_t *surf;
 	cairo_surface_pattern_t pattern;
 
-	surf = _cairo_image_surface_create_with_content (cairo_surface_get_content (&image_surf->base),
+	surf = _cairo_image_surface_create_with_content (image_surf->base.content,
 							 image_surf->width,
 							 image_surf->height);
 	image = (cairo_image_surface_t *) surf;
@@ -2715,7 +2715,7 @@ _cairo_pdf_surface_emit_recording_surface (cairo_pdf_surface_t        *surface,
     if (unlikely (status))
 	goto err;
 
-    if (cairo_surface_get_content (source) == CAIRO_CONTENT_COLOR) {
+    if (source->content == CAIRO_CONTENT_COLOR) {
 	status = _cairo_pdf_surface_add_alpha (surface, 1.0, &alpha);
 	if (unlikely (status))
 	    goto err;
@@ -6124,8 +6124,7 @@ _surface_pattern_supported (cairo_surface_pattern_t *pattern)
      * don't think it's worth the extra code to support it. */
 
 /* XXX: Need to write this function here...
-    content = cairo_surface_get_content (pattern->surface);
-    if (content == CAIRO_CONTENT_ALPHA)
+    if (pattern->surface->content == CAIRO_CONTENT_ALPHA)
 	return FALSE;
 */
 
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 6912c02..8f8e34f 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2407,7 +2407,7 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t    *surface,
 	cairo_surface_t *surf;
 	cairo_surface_pattern_t pattern;
 
-	surf = _cairo_image_surface_create_with_content (cairo_surface_get_content (&image_surf->base),
+	surf = _cairo_image_surface_create_with_content (image_surf->base.content,
 							 image_surf->width,
 							 image_surf->height);
 	image = (cairo_image_surface_t *) surf;
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index e208022..715054c 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -238,7 +238,6 @@ cairo_surface_get_content (cairo_surface_t *surface)
 {
     return surface->content;
 }
-slim_hidden_def(cairo_surface_get_content);
 
 /**
  * cairo_surface_status:
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 824a27d..f32d522 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -2393,7 +2393,7 @@ _cairo_svg_surface_mask (void		    *abstract_surface,
 
     if (mask->type == CAIRO_PATTERN_TYPE_SURFACE) {
 	const cairo_surface_pattern_t *surface_pattern = (const cairo_surface_pattern_t*) mask;
-	cairo_content_t content = cairo_surface_get_content (surface_pattern->surface);
+	cairo_content_t content = surface_pattern->surface->content;
 	if (content == CAIRO_CONTENT_ALPHA)
 	    discard_filter = TRUE;
     }
diff --git a/src/cairoint.h b/src/cairoint.h
index b27f8ad..578d6b3 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1913,7 +1913,6 @@ slim_hidden_proto (cairo_surface_create_similar_image);
 slim_hidden_proto (cairo_surface_destroy);
 slim_hidden_proto (cairo_surface_finish);
 slim_hidden_proto (cairo_surface_flush);
-slim_hidden_proto (cairo_surface_get_content);
 slim_hidden_proto (cairo_surface_get_device_offset);
 slim_hidden_proto (cairo_surface_get_font_options);
 slim_hidden_proto (cairo_surface_get_mime_data);


More information about the cairo-commit mailing list