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:
Benjamin Otte 2010-05-13 12:07:53 +02:00
parent 108e3f5031
commit ec1ca17b71

View file

@ -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);