gl: Make the backend struct static

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-05 14:40:19 +00:00
parent 934a3dcc6b
commit 3edf369ead
2 changed files with 5 additions and 4 deletions

View file

@ -342,8 +342,6 @@ typedef struct _cairo_gl_font {
cairo_list_t link;
} cairo_gl_font_t;
cairo_private extern const cairo_surface_backend_t _cairo_gl_surface_backend;
static cairo_always_inline GLenum
_cairo_gl_get_error (void)
{

View file

@ -49,6 +49,8 @@
#include "cairo-image-surface-private.h"
#include "cairo-surface-backend-private.h"
static const cairo_surface_backend_t _cairo_gl_surface_backend;
static cairo_status_t
_cairo_gl_surface_flush (void *abstract_surface);
@ -379,6 +381,8 @@ _cairo_gl_surface_init (cairo_device_t *device,
cairo_content_t content,
int width, int height)
{
assert (width > 0 && height > 0);
_cairo_surface_init (&surface->base,
&_cairo_gl_surface_backend,
device,
@ -401,7 +405,6 @@ _cairo_gl_surface_create_scratch_for_texture (cairo_gl_context_t *ctx,
cairo_gl_surface_t *surface;
assert (width <= ctx->max_framebuffer_size && height <= ctx->max_framebuffer_size);
surface = calloc (1, sizeof (cairo_gl_surface_t));
if (unlikely (surface == NULL))
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
@ -1233,7 +1236,7 @@ _cairo_gl_surface_glyphs (void *surface,
clip);
}
const cairo_surface_backend_t _cairo_gl_surface_backend = {
static const cairo_surface_backend_t _cairo_gl_surface_backend = {
CAIRO_SURFACE_TYPE_GL,
_cairo_gl_surface_finish,
_cairo_default_context_create,