forked from AuroraMiddleware/gtk
broadway: Don't create overlarge images
Respect that cairo won't create image surfaces larger than 32767 x 32767. This makes the one reftest pass that specifically checks this condition, treeview-crash-too-wide.
This commit is contained in:
parent
13f8583934
commit
5851415fca
@ -756,7 +756,14 @@ gsk_broadway_renderer_add_node (GskRenderer *renderer,
|
||||
int height = ceil (node->bounds.origin.y + node->bounds.size.height) - y;
|
||||
int scale = broadway_display->scale_factor;
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width * scale, height * scale);
|
||||
#define MAX_IMAGE_SIZE 32767
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
MIN (width * scale, MAX_IMAGE_SIZE),
|
||||
MIN (height * scale, MAX_IMAGE_SIZE));
|
||||
|
||||
#undef MAX_IMAGE_SIZE
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_scale (cr, scale, scale);
|
||||
cairo_translate (cr, -x, -y);
|
||||
|
Loading…
Reference in New Issue
Block a user