[cairo-commit] cairo/src cairo-image-surface.c, 1.69,
1.70 cairo-meta-surface-private.h, 1.11,
1.12 cairo-meta-surface.c, 1.24,
1.25 cairo-paginated-surface-private.h, 1.2,
1.3 cairo-paginated-surface.c, 1.9, 1.10 cairo-pdf-surface.c,
1.72, 1.73 cairo-pdf.h, 1.12, 1.13 cairo-ps-surface.c, 1.68,
1.69 cairo-ps.h, 1.8, 1.9 cairoint.h, 1.242,
1.243 test-fallback-surface.c, 1.4,
1.5 test-fallback-surface.h, 1.2, 1.3 test-meta-surface.c, 1.3,
1.4 test-meta-surface.h, 1.2, 1.3 test-paginated-surface.c,
1.1, 1.2 test-paginated-surface.h, 1.1, 1.2
Carl Worth
commit at pdx.freedesktop.org
Tue Jan 17 17:01:42 PST 2006
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv7119/src
Modified Files:
cairo-image-surface.c cairo-meta-surface-private.h
cairo-meta-surface.c cairo-paginated-surface-private.h
cairo-paginated-surface.c cairo-pdf-surface.c cairo-pdf.h
cairo-ps-surface.c cairo-ps.h cairoint.h
test-fallback-surface.c test-fallback-surface.h
test-meta-surface.c test-meta-surface.h
test-paginated-surface.c test-paginated-surface.h
Log Message:
2006-01-17 Carl Worth <cworth at cworth.org>
Big change to the test infrastructure and supporting
internals. The goal now is to test both a COLOR_ALPHA and a COLOR
content for each surface backend, (since the semantics are
different and we probably need to support both in each backend.
The PS/PDF backends don't allow a content to be passed in right
now, so they fail against the rgb24 tests, but the trivial
addition to the constructors will allow them to pass all tests
with both content values.
* src/cairoint.h:
* src/cairo-image-surface.c:
(_cairo_image_surface_create_with_content),
(_cairo_image_surface_create_for_data_with_content),
(_cairo_image_surface_create_similar): And new constructors
(currently internal only) to create an image surface with a
cairo_content_t rather than a cairo_format_t.
* src/cairo-meta-surface-private.h:
* src/cairo-meta-surface.c: (_cairo_meta_surface_create),
(_cairo_meta_surface_create_similar): Add a cairo_content_t
argument to the constructor.
* src/cairo-paginated-surface-private.h:
* src/cairo-paginated-surface.c: (_cairo_paginated_surface_create),
(_cairo_paginated_surface_acquire_source_image), (_paint_page),
(_cairo_paginated_surface_show_page),
(_cairo_paginated_surface_snapshot): Add a cairo_content_t to the
constructor and use this content value when constructing
intermediate image surfaces in acquire_source, show_page,
copy_page, and snapshot.
* src/cairo-pdf-surface.c: (emit_image_rgb_data),
(_cairo_pdf_surface_composite_image), (emit_surface_pattern): Add
image flattening by compositing over white, as is done in
cairo-ps-surface.c.
* src/cairo-ps-surface.c:
(_cairo_ps_surface_create_for_stream_internal),
(cairo_ps_surface_create), (cairo_ps_surface_create_for_stream):
* src/cairo-pdf-surface.c:
(_cairo_pdf_surface_create_for_stream_internal),
(cairo_pdf_surface_create_for_stream), (cairo_pdf_surface_create),
Track changes to cairo-paginates-surface which now requires a
cairo_content_t value (no change to public PS/PDF constructors
yet).
* src/test-fallback-surface.h:
* src/test-fallback-surface.c: (_test_fallback_surface_create),
(_test_fallback_surface_create_similar):
* src/test-meta-surface.h:
* src/test-meta-surface.c: (_test_meta_surface_create):
* src/test-paginated-surface.h:
* src/test-paginated-surface.c:
(_test_paginated_surface_create_for_data): Track change in
meta-surface and paginated-surface interfaces by now accepting a
cairo_content_t rather than a cairo_format_t.
* test/.cvsignore: Ignore new output files (argb32 from pdf and ps
as well as rgb24 from test-fallback, test-meta, and
test-paginated).
* test/Makefile.am:
* test/png-flatten.c: (main): Add new utility for flattening PNG
images in order to generate the -argbf-ref.png images.
* test/buffer-diff.c: (image_diff_flattened):
* test/buffer-diff.h: Add image_diff_flattened for comparing
flattened output from PS and PDF backend with ARGB reference
images by first blending the reference images over white.
* test/cairo-test.c: (_cairo_test_content_name),
(create_image_surface), (create_test_fallback_surface),
(create_test_meta_surface), (create_test_paginated_surface),
(test_paginated_write_to_png), (create_cairo_glitz_glx_surface),
(create_cairo_glitz_agl_surface), (create_cairo_glitz_wgl_surface),
(create_win32_surface), (create_xcb_surface),
(create_xlib_surface), (create_ps_surface), (create_pdf_surface),
(create_svg_surface), (cairo_test_for_target),
(cairo_test_expecting): Get rid of conditional, format-specific
background-color initialization before running tests. Now uses
ARGB(0,0,0,0) in all cases. Switch from specifying tests with a
format value to specifying tests with a content value. Add support
for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and
PDF output against a flattened version of the argb32 reference
images (first blended over white).
* test/multi-page.c: (main): Track change in
cairo_ps_surface_create (now requires cairo_content_t value).
* test/caps-joins.c: (draw):
* test/caps-sub-paths.c: (draw):
* test/dash-caps-joins.c: (draw):
* test/dash-offset-negative.c: (draw):
* test/leaky-polygon.c: (draw):
* test/line-width.c: (draw):
* test/path-data.c: (draw):
* test/show-text-current-point.c: (draw):
* test/text-antialias-gray.c: (draw):
* test/text-antialias-none.c: (draw):
* test/transforms.c: (draw): Adjust tests that draw in default
(black) to first paint white so that the results are visible.
* test/caps-joins-ref.png:
* test/caps-sub-paths-ref.png:
* test/dash-caps-joins-ref.png:
* test/dash-offset-negative-ref.png:
* test/leaky-polygon-ref.png:
* test/line-width-ref.png:
* test/path-data-ref.png:
* test/show-text-current-point-ref.png:
* test/text-antialias-gray-ref.png:
* test/text-antialias-none-ref.png:
* test/transforms-ref.png: Adjust ARGB32 reference images for new
white background for changed tests.
* test/clip-fill-rule-pixel-aligned-rgb24-ref.png:
* test/clip-fill-rule-rgb24-ref.png:
* test/clip-nesting-rgb24-ref.png:
* test/clip-operator-rgb24-ref.png:
* test/clip-twice-rgb24-ref.png:
* test/fill-and-stroke-rgb24-ref.png:
* test/fill-rule-rgb24-ref.png:
* test/gradient-alpha-rgb24-ref.png:
* test/mask-ctm-rgb24-ref.png:
* test/mask-rgb24-ref.png:
* test/mask-surface-ctm-rgb24-ref.png:
* test/nil-surface-rgb24-ref.png:
* test/operator-clear-rgb24-ref.png:
* test/operator-source-rgb24-ref.png:
* test/paint-with-alpha-rgb24-ref.png:
* test/rel-path-rgb24-ref.png:
* test/scale-source-surface-paint-rgb24-ref.png:
* test/set-source-rgb24-ref.png:
* test/source-surface-scale-paint-rgb24-ref.png:
* test/text-pattern-rgb24-ref.png:
* test/trap-clip-rgb24-ref.png:
* test/unbounded-operator-rgb24-ref.png: Adjust RGB24 reference
images for new black background due to changed initialization (and
the tests themselves being unchanged).
Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- cairo-image-surface.c 5 Jan 2006 01:59:03 -0000 1.69
+++ cairo-image-surface.c 18 Jan 2006 01:01:37 -0000 1.70
@@ -232,6 +232,18 @@
return surface;
}
+cairo_surface_t *
+_cairo_image_surface_create_with_content (cairo_content_t content,
+ int width,
+ int height)
+{
+ if (! CAIRO_CONTENT_VALID (content))
+ return (cairo_surface_t*) &_cairo_surface_nil;
+
+ return cairo_image_surface_create (_cairo_format_from_content (content),
+ width, height);
+}
+
/**
* cairo_image_surface_create_for_data:
* @data: a pointer to a buffer supplied by the application
@@ -296,6 +308,21 @@
return surface;
}
+cairo_surface_t *
+_cairo_image_surface_create_for_data_with_content (unsigned char *data,
+ cairo_content_t content,
+ int width,
+ int height,
+ int stride)
+{
+ if (! CAIRO_CONTENT_VALID (content))
+ return (cairo_surface_t*) &_cairo_surface_nil;
+
+ return cairo_image_surface_create_for_data (data,
+ _cairo_format_from_content (content),
+ width, height, stride);
+}
+
/**
* cairo_image_surface_get_width:
* @surface: a #cairo_image_surface_t
@@ -379,8 +406,8 @@
{
assert (CAIRO_CONTENT_VALID (content));
- return cairo_image_surface_create (_cairo_format_from_content (content),
- width, height);
+ return _cairo_image_surface_create_with_content (content,
+ width, height);
}
static cairo_status_t
Index: cairo-meta-surface-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-meta-surface-private.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cairo-meta-surface-private.h 21 Dec 2005 20:07:26 -0000 1.11
+++ cairo-meta-surface-private.h 18 Jan 2006 01:01:39 -0000 1.12
@@ -127,6 +127,8 @@
typedef struct _cairo_meta_surface {
cairo_surface_t base;
+ cairo_content_t content;
+
/* A meta-surface is logically unbounded, but when used as a
* source we need to render it to an image, so we need a size at
* which to create that image. */
@@ -138,7 +140,9 @@
} cairo_meta_surface_t;
cairo_private cairo_surface_t *
-_cairo_meta_surface_create (int width_pixels, int height_pixels);
+_cairo_meta_surface_create (cairo_content_t content,
+ int width_pixels,
+ int height_pixels);
cairo_private cairo_status_t
_cairo_meta_surface_replay (cairo_surface_t *surface,
Index: cairo-meta-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-meta-surface.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cairo-meta-surface.c 22 Dec 2005 00:35:33 -0000 1.24
+++ cairo-meta-surface.c 18 Jan 2006 01:01:39 -0000 1.25
@@ -60,7 +60,9 @@
static const cairo_surface_backend_t cairo_meta_surface_backend;
cairo_surface_t *
-_cairo_meta_surface_create (int width_pixels, int height_pixels)
+_cairo_meta_surface_create (cairo_content_t content,
+ int width_pixels,
+ int height_pixels)
{
cairo_meta_surface_t *meta;
@@ -72,6 +74,7 @@
_cairo_surface_init (&meta->base, &cairo_meta_surface_backend);
+ meta->content = content;
meta->width_pixels = width_pixels;
meta->height_pixels = height_pixels;
@@ -87,7 +90,7 @@
int width,
int height)
{
- return _cairo_meta_surface_create (width, height);
+ return _cairo_meta_surface_create (content, width, height);
}
static cairo_status_t
Index: cairo-paginated-surface-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-paginated-surface-private.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo-paginated-surface-private.h 11 Jan 2006 19:53:33 -0000 1.2
+++ cairo-paginated-surface-private.h 18 Jan 2006 01:01:39 -0000 1.3
@@ -40,6 +40,7 @@
cairo_private cairo_surface_t *
_cairo_paginated_surface_create (cairo_surface_t *target,
+ cairo_content_t content,
int width,
int height);
Index: cairo-paginated-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-paginated-surface.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cairo-paginated-surface.c 13 Jan 2006 19:02:25 -0000 1.9
+++ cairo-paginated-surface.c 18 Jan 2006 01:01:39 -0000 1.10
@@ -72,6 +72,8 @@
typedef struct _cairo_paginated_surface {
cairo_surface_t base;
+ cairo_content_t content;
+
/* XXX: These shouldn't actually exist. We inherit this ugliness
* from _cairo_meta_surface_create. The width/height parameters
* from that function also should not exist. The fix that will
@@ -97,6 +99,7 @@
cairo_surface_t *
_cairo_paginated_surface_create (cairo_surface_t *target,
+ cairo_content_t content,
int width,
int height)
{
@@ -108,12 +111,13 @@
_cairo_surface_init (&surface->base, &cairo_paginated_surface_backend);
+ surface->content = content;
surface->width = width;
surface->height = height;
surface->target = target;
- surface->meta = _cairo_meta_surface_create (width, height);
+ surface->meta = _cairo_meta_surface_create (content, width, height);
if (cairo_surface_status (surface->meta))
goto FAIL_CLEANUP_SURFACE;
@@ -166,8 +170,9 @@
_cairo_surface_get_extents (surface->target, &extents);
- image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- extents.width, extents.height);
+ image = _cairo_image_surface_create_with_content (surface->content,
+ extents.width,
+ extents.height);
_cairo_meta_surface_replay (surface->meta, image);
@@ -191,8 +196,9 @@
cairo_surface_t *image;
cairo_pattern_t *pattern;
- image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- surface->width, surface->height);
+ image = _cairo_image_surface_create_with_content (surface->content,
+ surface->width,
+ surface->height);
_cairo_meta_surface_replay (surface->meta, image);
@@ -236,7 +242,8 @@
cairo_surface_destroy (surface->meta);
- surface->meta = _cairo_meta_surface_create (surface->width, surface->height);
+ surface->meta = _cairo_meta_surface_create (surface->content,
+ surface->width, surface->height);
if (cairo_surface_status (surface->meta))
return cairo_surface_status (surface->meta);
@@ -362,9 +369,9 @@
_cairo_surface_get_extents (other->target, &extents);
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- extents.width,
- extents.height);
+ surface = _cairo_image_surface_create_with_content (other->content,
+ extents.width,
+ extents.height);
_cairo_meta_surface_replay (other->meta, surface);
Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- cairo-pdf-surface.c 11 Jan 2006 19:53:33 -0000 1.72
+++ cairo-pdf-surface.c 18 Jan 2006 01:01:39 -0000 1.73
@@ -287,8 +287,9 @@
static cairo_surface_t *
_cairo_pdf_surface_create_for_stream_internal (cairo_output_stream_t *stream,
- double width,
- double height)
+ cairo_content_t content,
+ double width,
+ double height)
{
cairo_pdf_document_t *document;
cairo_surface_t *target;
@@ -304,14 +305,14 @@
document->owner = target;
_cairo_pdf_document_destroy (document);
- return _cairo_paginated_surface_create (target, width, height);
+ return _cairo_paginated_surface_create (target, content, width, height);
}
cairo_surface_t *
-cairo_pdf_surface_create_for_stream (cairo_write_func_t write,
+cairo_pdf_surface_create_for_stream (cairo_write_func_t write,
void *closure,
- double width,
- double height)
+ double width,
+ double height)
{
cairo_output_stream_t *stream;
@@ -321,13 +322,17 @@
return (cairo_surface_t*) &_cairo_surface_nil;
}
- return _cairo_pdf_surface_create_for_stream_internal (stream, width, height);
+ /* XXX: content here is hard-coded but should be passed in (API
+ * change that needs to be discussed on the list). */
+ return _cairo_pdf_surface_create_for_stream_internal (stream,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ width, height);
}
cairo_surface_t *
-cairo_pdf_surface_create (const char *filename,
- double width,
- double height)
+cairo_pdf_surface_create (const char *filename,
+ double width,
+ double height)
{
cairo_output_stream_t *stream;
@@ -337,7 +342,11 @@
return (cairo_surface_t*) &_cairo_surface_nil;
}
- return _cairo_pdf_surface_create_for_stream_internal (stream, width, height);
+ /* XXX: content here is hard-coded but should be passed in (API
+ * change that needs to be discussed on the list). */
+ return _cairo_pdf_surface_create_for_stream_internal (stream,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ width, height);
}
static cairo_bool_t
@@ -581,9 +590,12 @@
return compressed;
}
+/* XXX: This should be rewritten to use the standard cairo_status_t
+ * return and the error paths here need to be checked for memory
+ * leaks. */
static unsigned int
-emit_image_data (cairo_pdf_document_t *document,
- cairo_image_surface_t *image)
+emit_image_rgb_data (cairo_pdf_document_t *document,
+ cairo_image_surface_t *image)
{
cairo_output_stream_t *output = document->output_stream;
cairo_pdf_stream_t *stream;
@@ -591,17 +603,55 @@
int i, x, y;
unsigned long rgb_size, compressed_size;
pixman_bits_t *pixel;
+ cairo_surface_t *opaque;
+ cairo_image_surface_t *opaque_image;
+ cairo_pattern_union_t pattern;
rgb_size = image->height * image->width * 3;
rgb = malloc (rgb_size);
if (rgb == NULL)
return 0;
+ /* XXX: We could actually output the alpha channels through PDF
+ * 1.4's SMask. But for now, all we support is opaque image data,
+ * so we must flatten any ARGB image by blending over white
+ * first. */
+ if (image->format != CAIRO_FORMAT_RGB24) {
+ opaque = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+ image->width,
+ image->height);
+ if (opaque->status)
+ return 0;
+
+ _cairo_pattern_init_for_surface (&pattern.surface, &image->base);
+
+ _cairo_surface_fill_rectangle (opaque,
+ CAIRO_OPERATOR_SOURCE,
+ CAIRO_COLOR_WHITE,
+ 0, 0, image->width, image->height);
+
+ _cairo_surface_composite (CAIRO_OPERATOR_OVER,
+ &pattern.base,
+ NULL,
+ opaque,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ image->width,
+ image->height);
+
+ _cairo_pattern_fini (&pattern.base);
+ opaque_image = (cairo_image_surface_t *) opaque;
+ } else {
+ opaque = &image->base;
+ opaque_image = image;
+ }
+
i = 0;
for (y = 0; y < image->height; y++) {
- pixel = (pixman_bits_t *) (image->data + y * image->stride);
+ pixel = (pixman_bits_t *) (opaque_image->data + y * opaque_image->stride);
- for (x = 0; x < image->width; x++, pixel++) {
+ for (x = 0; x < opaque_image->width; x++, pixel++) {
rgb[i++] = (*pixel & 0x00ff0000) >> 16;
rgb[i++] = (*pixel & 0x0000ff00) >> 8;
rgb[i++] = (*pixel & 0x000000ff) >> 0;
@@ -634,6 +684,9 @@
free (rgb);
free (compressed);
+ if (opaque_image != image)
+ cairo_surface_destroy (opaque);
+
return stream->id;
}
@@ -655,7 +708,7 @@
if (status)
return status;
- id = emit_image_data (dst->document, image);
+ id = emit_image_rgb_data (dst->document, image);
if (id == 0) {
status = CAIRO_STATUS_NO_MEMORY;
goto bail;
@@ -835,7 +888,7 @@
_cairo_pdf_document_close_stream (document);
- id = emit_image_data (dst->document, image);
+ id = emit_image_rgb_data (dst->document, image);
/* BBox must be smaller than XStep by YStep or acroread wont
* display the pattern. */
Index: cairo-pdf.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cairo-pdf.h 7 Sep 2005 23:31:22 -0000 1.12
+++ cairo-pdf.h 18 Jan 2006 01:01:39 -0000 1.13
@@ -44,9 +44,9 @@
CAIRO_BEGIN_DECLS
cairo_public cairo_surface_t *
-cairo_pdf_surface_create (const char *filename,
- double width_in_points,
- double height_in_points);
+cairo_pdf_surface_create (const char *filename,
+ double width_in_points,
+ double height_in_points);
cairo_public cairo_surface_t *
cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func,
Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- cairo-ps-surface.c 13 Jan 2006 21:41:45 -0000 1.68
+++ cairo-ps-surface.c 18 Jan 2006 01:01:40 -0000 1.69
@@ -122,6 +122,7 @@
static cairo_surface_t *
_cairo_ps_surface_create_for_stream_internal (cairo_output_stream_t *stream,
+ cairo_content_t content,
double width,
double height)
{
@@ -155,13 +156,14 @@
_cairo_ps_surface_emit_header (surface);
- return _cairo_paginated_surface_create (&surface->base, width, height);
+ return _cairo_paginated_surface_create (&surface->base,
+ content, width, height);
}
cairo_surface_t *
-cairo_ps_surface_create (const char *filename,
- double width_in_points,
- double height_in_points)
+cairo_ps_surface_create (const char *filename,
+ double width_in_points,
+ double height_in_points)
{
cairo_output_stream_t *stream;
@@ -171,7 +173,10 @@
return (cairo_surface_t*) &_cairo_surface_nil;
}
+ /* XXX: content here is hard-coded but should be passed in (API
+ * change that needs to be discussed on the list). */
return _cairo_ps_surface_create_for_stream_internal (stream,
+ CAIRO_CONTENT_COLOR_ALPHA,
width_in_points,
height_in_points);
}
@@ -190,7 +195,10 @@
return (cairo_surface_t*) &_cairo_surface_nil;
}
+ /* XXX: content here is hard-coded but should be passed in (API
+ * change that needs to be discussed on the list). */
return _cairo_ps_surface_create_for_stream_internal (stream,
+ CAIRO_CONTENT_COLOR_ALPHA,
width_in_points,
height_in_points);
}
Index: cairo-ps.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cairo-ps.h 7 Sep 2005 23:31:22 -0000 1.8
+++ cairo-ps.h 18 Jan 2006 01:01:40 -0000 1.9
@@ -48,9 +48,9 @@
/* PS-surface functions */
cairo_public cairo_surface_t *
-cairo_ps_surface_create (const char *filename,
- double width_in_points,
- double height_in_points);
+cairo_ps_surface_create (const char *filename,
+ double width_in_points,
+ double height_in_points);
cairo_public cairo_surface_t *
cairo_ps_surface_create_for_stream (cairo_write_func_t write_func,
Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.242
retrieving revision 1.243
diff -u -d -r1.242 -r1.243
--- cairoint.h 6 Jan 2006 22:11:07 -0000 1.242
+++ cairoint.h 18 Jan 2006 01:01:40 -0000 1.243
@@ -1829,6 +1829,18 @@
int height,
int stride);
+cairo_private cairo_surface_t *
+_cairo_image_surface_create_with_content (cairo_content_t content,
+ int width,
+ int height);
+
+cairo_private cairo_surface_t *
+_cairo_image_surface_create_for_data_with_content (unsigned char *data,
+ cairo_content_t content,
+ int width,
+ int height,
+ int stride);
+
cairo_private void
_cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface);
Index: test-fallback-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-fallback-surface.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- test-fallback-surface.c 20 Dec 2005 18:30:11 -0000 1.4
+++ test-fallback-surface.c 18 Jan 2006 01:01:40 -0000 1.5
@@ -65,14 +65,14 @@
const cairo_private cairo_surface_backend_t test_fallback_surface_backend;
cairo_surface_t *
-_test_fallback_surface_create (cairo_format_t format,
+_test_fallback_surface_create (cairo_content_t content,
int width,
int height)
{
test_fallback_surface_t *surface;
cairo_surface_t *backing;
- backing = cairo_image_surface_create (format, width, height);
+ backing = _cairo_image_surface_create_with_content (content, width, height);
if (cairo_surface_status (backing))
return (cairo_surface_t*) &_cairo_surface_nil;
@@ -97,7 +97,7 @@
{
assert (CAIRO_CONTENT_VALID (content));
- return _test_fallback_surface_create (_cairo_format_from_content (content),
+ return _test_fallback_surface_create (content,
width, height);
}
Index: test-fallback-surface.h
===================================================================
RCS file: /cvs/cairo/cairo/src/test-fallback-surface.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test-fallback-surface.h 20 Dec 2005 18:30:11 -0000 1.2
+++ test-fallback-surface.h 18 Jan 2006 01:01:40 -0000 1.3
@@ -41,7 +41,7 @@
CAIRO_BEGIN_DECLS
cairo_surface_t *
-_test_fallback_surface_create (cairo_format_t format,
+_test_fallback_surface_create (cairo_content_t content,
int width,
int height);
Index: test-meta-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-meta-surface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test-meta-surface.c 22 Dec 2005 01:04:02 -0000 1.3
+++ test-meta-surface.c 18 Jan 2006 01:01:40 -0000 1.4
@@ -68,9 +68,9 @@
_test_meta_surface_show_page (void *abstract_surface);
cairo_surface_t *
-_test_meta_surface_create (cairo_format_t format,
- int width,
- int height)
+_test_meta_surface_create (cairo_content_t content,
+ int width,
+ int height)
{
test_meta_surface_t *surface;
@@ -80,11 +80,12 @@
_cairo_surface_init (&surface->base, &test_meta_surface_backend);
- surface->meta = _cairo_meta_surface_create (width, height);
+ surface->meta = _cairo_meta_surface_create (content, width, height);
if (cairo_surface_status (surface->meta))
goto FAIL_CLEANUP_SURFACE;
- surface->image = cairo_image_surface_create (format, width, height);
+ surface->image = _cairo_image_surface_create_with_content (content,
+ width, height);
if (cairo_surface_status (surface->image))
goto FAIL_CLEANUP_META;
Index: test-meta-surface.h
===================================================================
RCS file: /cvs/cairo/cairo/src/test-meta-surface.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test-meta-surface.h 21 Dec 2005 20:08:57 -0000 1.2
+++ test-meta-surface.h 18 Jan 2006 01:01:40 -0000 1.3
@@ -41,7 +41,7 @@
CAIRO_BEGIN_DECLS
cairo_surface_t *
-_test_meta_surface_create (cairo_format_t format,
+_test_meta_surface_create (cairo_content_t content,
int width,
int height);
Index: test-paginated-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-paginated-surface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test-paginated-surface.c 22 Dec 2005 00:46:44 -0000 1.1
+++ test-paginated-surface.c 18 Jan 2006 01:01:40 -0000 1.2
@@ -52,16 +52,17 @@
#include "cairo-paginated-surface-private.h"
cairo_surface_t *
-_test_paginated_surface_create_for_data (unsigned char *data,
- cairo_format_t format,
- int width,
- int height,
- int stride)
+_test_paginated_surface_create_for_data (unsigned char *data,
+ cairo_content_t content,
+ int width,
+ int height,
+ int stride)
{
cairo_surface_t *target;
- target = cairo_image_surface_create_for_data (data, format,
- width, height, stride);
+ target = _cairo_image_surface_create_for_data_with_content (data, content,
+ width, height,
+ stride);
- return _cairo_paginated_surface_create (target, width, height);
+ return _cairo_paginated_surface_create (target, content, width, height);
}
Index: test-paginated-surface.h
===================================================================
RCS file: /cvs/cairo/cairo/src/test-paginated-surface.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test-paginated-surface.h 22 Dec 2005 00:46:44 -0000 1.1
+++ test-paginated-surface.h 18 Jan 2006 01:01:40 -0000 1.2
@@ -41,11 +41,11 @@
CAIRO_BEGIN_DECLS
cairo_surface_t *
-_test_paginated_surface_create_for_data (unsigned char *data,
- cairo_format_t format,
- int width,
- int height,
- int stride);
+_test_paginated_surface_create_for_data (unsigned char *data,
+ cairo_content_t content,
+ int width,
+ int height,
+ int stride);
CAIRO_END_DECLS
More information about the cairo-commit
mailing list