mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-27 10:30:16 +01:00
cogl: Fix very small surfaces in boilerplate
Prior to this change, the boilerplate code crashed when given surface dimensions less than 1. This fixes such behaviour by rounding the dimensions up to 1, which is also done by the boilerplate code for several other backends. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
This commit is contained in:
parent
8f0f371b87
commit
f3d2623046
1 changed files with 10 additions and 0 deletions
|
|
@ -74,6 +74,11 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name,
|
|||
cogl_closure_t *closure;
|
||||
cairo_status_t status;
|
||||
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
if (!context)
|
||||
context = cogl_context_new (NULL, NULL);
|
||||
|
||||
|
|
@ -118,6 +123,11 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name,
|
|||
cogl_closure_t *closure;
|
||||
cairo_status_t status;
|
||||
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
if (!context)
|
||||
context = cogl_context_new (NULL, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue