extend-repeat.c 726 B

123456789101112131415161718192021222324252627
  1. #include "cairo-test.h"
  2. static const char *png_filename = "romedalen.png";
  3. static cairo_test_status_t
  4. draw (cairo_t *cr, int width, int height)
  5. {
  6. const cairo_test_context_t *ctx = cairo_test_get_context (cr);
  7. cairo_surface_t *surface;
  8. surface = cairo_test_create_surface_from_png (ctx, png_filename);
  9. cairo_set_source_surface (cr, surface, 32, 32);
  10. cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
  11. cairo_paint (cr);
  12. cairo_surface_destroy (surface);
  13. return CAIRO_TEST_SUCCESS;
  14. }
  15. CAIRO_TEST (extend_repeat,
  16. "Test CAIRO_EXTEND_REPEAT for surface patterns",
  17. "extend", /* keywords */
  18. NULL, /* requirements */
  19. 256 + 32*2, 192 + 32*2,
  20. NULL, draw)