summaryrefslogtreecommitdiff
path: root/src/cairo-gl-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-gl-surface.c')
-rw-r--r--src/cairo-gl-surface.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index e53506c..211fe02 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -214,6 +214,7 @@ _cairo_gl_surface_init (cairo_device_t *device,
surface->width = width;
surface->height = height;
+ surface->needs_update = FALSE;
}
static cairo_surface_t *
@@ -459,14 +460,17 @@ cairo_gl_surface_set_size (cairo_surface_t *abstract_surface,
}
if (! _cairo_surface_is_gl (abstract_surface) ||
- ! _cairo_gl_surface_is_texture (surface)) {
+ _cairo_gl_surface_is_texture (surface)) {
status = _cairo_surface_set_error (abstract_surface,
_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
return;
}
- surface->width = width;
- surface->height = height;
+ if (surface->width != width || surface->height != height) {
+ surface->needs_update = TRUE;
+ surface->width = width;
+ surface->height = height;
+ }
}
int
@@ -743,12 +747,14 @@ _cairo_gl_surface_get_image (cairo_gl_surface_t *surface,
glPixelStorei (GL_PACK_ALIGNMENT, 1);
glPixelStorei (GL_PACK_ROW_LENGTH, image->stride / cpp);
- if (! _cairo_gl_surface_is_texture (surface) && GLEW_MESA_pack_invert)
+ if (! _cairo_gl_surface_is_texture (surface) &&
+ ctx->has_mesa_pack_invert)
glPixelStorei (GL_PACK_INVERT_MESA, 1);
glReadPixels (interest->x, interest->y,
interest->width, interest->height,
format, type, image->data);
- if (! _cairo_gl_surface_is_texture (surface) && GLEW_MESA_pack_invert)
+ if (! _cairo_gl_surface_is_texture (surface) &&
+ ctx->has_mesa_pack_invert)
glPixelStorei (GL_PACK_INVERT_MESA, 0);
status = _cairo_gl_context_release (ctx, status);
@@ -785,9 +791,9 @@ _cairo_gl_surface_finish (void *abstract_surface)
ctx->current_target = NULL;
if (surface->depth)
- glDeleteFramebuffersEXT (1, &surface->depth);
+ ctx->dispatch.DeleteFramebuffers (1, &surface->depth);
if (surface->fb)
- glDeleteFramebuffersEXT (1, &surface->fb);
+ ctx->dispatch.DeleteFramebuffers (1, &surface->fb);
if (surface->owns_tex)
glDeleteTextures (1, &surface->tex);
@@ -1368,6 +1374,7 @@ _cairo_gl_surface_get_font_options (void *abstract_surface,
_cairo_font_options_init_default (options);
cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_ON);
+ _cairo_font_options_set_round_glyph_positions (options, CAIRO_ROUND_GLYPH_POS_ON);
}
static cairo_status_t
@@ -1503,8 +1510,7 @@ _cairo_gl_surface_stroke (void *abstract_surface,
return status;
}
- _cairo_polygon_init (&polygon);
- _cairo_polygon_limit (&polygon, clip_boxes, num_boxes);
+ _cairo_polygon_init (&polygon, clip_boxes, num_boxes);
status = _cairo_path_fixed_stroke_to_polygon (path,
style,
@@ -1580,8 +1586,7 @@ _cairo_gl_surface_fill (void *abstract_surface,
return status;
}
- _cairo_polygon_init (&polygon);
- _cairo_polygon_limit (&polygon, clip_boxes, num_boxes);
+ _cairo_polygon_init (&polygon, clip_boxes, num_boxes);
status = _cairo_path_fixed_fill_to_polygon (path, tolerance, &polygon);
if (likely (status == CAIRO_STATUS_SUCCESS)) {