summaryrefslogtreecommitdiff
path: root/test/api-special-cases.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-05 22:30:55 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-05 22:40:34 +0200
commita9f30fc1f0c3e50715468b09707477973bf5268b (patch)
tree874d5663c9e258020f67f7b2d595489992995bcb /test/api-special-cases.c
parent41abc0ca37855751ed06051a30c0d866977ed2bd (diff)
downloadcairo-a9f30fc1f0c3e50715468b09707477973bf5268b.tar.gz
test: Add recording and tee surface functions to api-special-cases
Diffstat (limited to 'test/api-special-cases.c')
-rw-r--r--test/api-special-cases.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index ad8629bd3..a72f86ae1 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -336,6 +336,46 @@ test_cairo_surface_write_to_png_stream (cairo_surface_t *surface)
#endif
+static cairo_test_status_t
+test_cairo_recording_surface_ink_extents (cairo_surface_t *surface)
+{
+ double x, y, w, h;
+
+ cairo_recording_surface_ink_extents (surface, &x, &y, &w, &h);
+ return x == 0 && y == 0 && w == 0 && h == 0 ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_tee_surface_add (cairo_surface_t *surface)
+{
+ cairo_surface_t *image = cairo_image_surface_create (CAIRO_FORMAT_A8, 10, 10);
+
+ cairo_tee_surface_add (surface, image);
+ cairo_surface_destroy (image);
+ return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_tee_surface_remove (cairo_surface_t *surface)
+{
+ cairo_surface_t *image = cairo_image_surface_create (CAIRO_FORMAT_A8, 10, 10);
+
+ cairo_tee_surface_remove (surface, image);
+ cairo_surface_destroy (image);
+ return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_tee_surface_index (cairo_surface_t *surface)
+{
+ cairo_surface_t *master;
+ cairo_status_t status;
+
+ master = cairo_tee_surface_index (surface, 0);
+ status = cairo_surface_status (master);
+ cairo_surface_destroy (master);
+ return status ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
#define TEST(name, surface_type, sets_status) { #name, test_ ## name, surface_type, sets_status }
@@ -378,6 +418,10 @@ struct {
TEST (cairo_surface_write_to_png, -1, FALSE),
TEST (cairo_surface_write_to_png_stream, -1, FALSE),
#endif
+ TEST (cairo_recording_surface_ink_extents, CAIRO_SURFACE_TYPE_RECORDING, FALSE),
+ TEST (cairo_tee_surface_add, CAIRO_SURFACE_TYPE_TEE, TRUE),
+ TEST (cairo_tee_surface_remove, CAIRO_SURFACE_TYPE_TEE, TRUE),
+ TEST (cairo_tee_surface_index, CAIRO_SURFACE_TYPE_TEE, FALSE),
};
static cairo_test_status_t