summaryrefslogtreecommitdiff
path: root/test/fallback.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2012-01-15 20:56:25 +1030
committerAdrian Johnson <ajohnson@redneon.com>2012-01-15 21:18:43 +1030
commit284cba1f3776b9d9e80f6f0acdca67e4828861c1 (patch)
treea3c3dc3377ac30eaaa976692013afeec7b6dabbb /test/fallback.c
parent9a199fd4031986dfba99e7d6ceb63ec7cea81cad (diff)
downloadcairo-284cba1f3776b9d9e80f6f0acdca67e4828861c1.tar.gz
test: add push/pop group to fallback test
Diffstat (limited to 'test/fallback.c')
-rw-r--r--test/fallback.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/fallback.c b/test/fallback.c
index d4421d829..a3cfc401c 100644
--- a/test/fallback.c
+++ b/test/fallback.c
@@ -27,16 +27,16 @@
#include "cairo-test.h"
#define SIZE 40
-#define WIDTH (4*SIZE)
-#define HEIGHT WIDTH
+#define WIDTH (7*SIZE)
+#define HEIGHT (5*SIZE)
#define FALLBACK_RES_X 300
#define FALLBACK_RES_Y 150
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
+static void
+rectangles (cairo_t *cr)
{
- cairo_surface_set_fallback_resolution (cairo_get_target (cr), FALLBACK_RES_X, FALLBACK_RES_Y);
+ cairo_save (cr);
cairo_rotate (cr, M_PI/8);
cairo_translate (cr, 2*SIZE, SIZE/16);
@@ -53,6 +53,21 @@ draw (cairo_t *cr, int width, int height)
cairo_set_source_rgba (cr, 0, 1, 0, 0.5);
cairo_fill (cr);
+ cairo_restore (cr);
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_surface_set_fallback_resolution (cairo_get_target (cr), FALLBACK_RES_X, FALLBACK_RES_Y);
+
+ rectangles (cr);
+ cairo_translate (cr, 3*SIZE, 0);
+ cairo_push_group (cr);
+ rectangles (cr);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+
return CAIRO_TEST_SUCCESS;
}