Does not draw with radial pattern if scaling is too small
Submitted by Jason Crain
Assigned to Chris Wilson @ickle
Description
Cairo will not fill with a radial pattern if the matrix scaling is too small. The following code is inspired by poppler bug #22098, regarding an incorrectly rendered PDF:
cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 300, 300);
cairo_t *cr = cairo_create (surface);
cairo_scale (cr, 0.001, 0.001);
cairo_pattern_t *pattern = cairo_pattern_create_radial (0, 0, 0, 0, 0, 50000);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
cairo_pattern_add_color_stop_rgb (pattern, 0, 0, 1, 0);
cairo_pattern_add_color_stop_rgb (pattern, 1, 0, 0, 1);
cairo_rectangle (cr, 0, 0, 300000, 300000);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_surface_write_to_png (surface, "a.png");
Cairo will not draw anything with the scaling "0.001", but it will draw if the scaling is larger, such as "0.005". The exact value seems to change depending on the pattern's matrix, so I might be able to work around the problem with cairo_pattern_set_matrix. I've noticed the same problem with a surface pattern.
Using cairo and pixman from git master.