test: add push/pop group to fallback test

This commit is contained in:
Adrian Johnson 2012-01-15 20:56:25 +10:30
parent 9a199fd403
commit 284cba1f37
3 changed files with 20 additions and 5 deletions

View file

@ -27,16 +27,16 @@
#include "cairo-test.h" #include "cairo-test.h"
#define SIZE 40 #define SIZE 40
#define WIDTH (4*SIZE) #define WIDTH (7*SIZE)
#define HEIGHT WIDTH #define HEIGHT (5*SIZE)
#define FALLBACK_RES_X 300 #define FALLBACK_RES_X 300
#define FALLBACK_RES_Y 150 #define FALLBACK_RES_Y 150
static cairo_test_status_t static void
draw (cairo_t *cr, int width, int height) 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_rotate (cr, M_PI/8);
cairo_translate (cr, 2*SIZE, SIZE/16); 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_set_source_rgba (cr, 0, 1, 0, 0.5);
cairo_fill (cr); 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; return CAIRO_TEST_SUCCESS;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB