mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-17 10:10:33 +01:00
gl: Don't create 0x0 surfaces
We get a very annoyed libGL if we try to create 0x0 textures, so we return an image surface instead. Tested by the zero-mask test.
This commit is contained in:
parent
108e3f5031
commit
ec1ca17b71
1 changed files with 4 additions and 0 deletions
|
|
@ -535,6 +535,10 @@ _cairo_gl_surface_create_similar (void *abstract_surface,
|
|||
cairo_gl_context_t *ctx;
|
||||
cairo_status_t status;
|
||||
|
||||
if (width < 1 || height < 1)
|
||||
return cairo_image_surface_create (_cairo_format_from_content (content),
|
||||
width, height);
|
||||
|
||||
status = _cairo_gl_context_acquire (surface->device, &ctx);
|
||||
if (unlikely (status))
|
||||
return _cairo_surface_create_in_error (status);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue