cairo-gl patch for cairo_rectangle_int_t

Matt Peterson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CACEDMX+qsHyhZFjhUrxbTOiSvxp76vGGBJGp2CF8Nadfa+=jrQ@mail.gmail.com>
I was trying to build cairo-gl for wayland, and I found that it wouldn't
build because the GL backend hadn't been updated for cairo_rectangle_int_t.
Attached is a patch that allowed me to build it.
--
Matt Peterson

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
0001-gl-Use-cairo_rectangle_int_t.patch (application/octet-stream, 3 KB)
From 157b59e14dde2b2e24c3c7be9336b25f4d52755d Mon Sep 17 00:00:00 2001
From: Matt Peterson <[email protected]>
Date: Wed, 27 Jul 2011 14:48:31 -0600
Subject: [PATCH] gl: Use cairo_rectangle_int_t

---
 src/cairo-gl-glyphs.c  |   10 ++++++++--
 src/cairo-gl-surface.c |   12 +++++++-----
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index 81efbbb..ba09442 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -437,6 +437,11 @@ _cairo_gl_surface_show_glyphs_via_mask (cairo_gl_surface_t	*dst,
     return status;
 }
 
+
+cairo_private cairo_bool_t
+_cairo_gl_surface_get_extents (void		     *abstract_surface,
+			       cairo_rectangle_int_t *rectangle);
+
 cairo_int_status_t
 _cairo_gl_surface_show_glyphs (void			*abstract_dst,
 			       cairo_operator_t		 op,
@@ -449,6 +454,7 @@ _cairo_gl_surface_show_glyphs (void			*abstract_dst,
 {
     cairo_gl_surface_t *dst = abstract_dst;
     cairo_composite_rectangles_t extents;
+    cairo_rectangle_int_t unbounded;
     cairo_bool_t overlap, use_mask = FALSE;
     cairo_bool_t has_component_alpha;
     cairo_status_t status;
@@ -534,9 +540,9 @@ _cairo_gl_surface_show_glyphs (void			*abstract_dst,
     if (! _cairo_gl_surface_owns_font (dst, scaled_font))
 	return UNSUPPORTED ("do not control font");
 
+    _cairo_gl_surface_get_extents (dst, &unbounded);
     status = _cairo_composite_rectangles_init_for_glyphs (&extents,
-							  dst->width,
-							  dst->height,
+							  &unbounded,
 							  op, source,
 							  scaled_font,
 							  glyphs, num_glyphs,
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 7d27ecd..fde9335 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -1581,7 +1581,7 @@ FAIL:
     return _cairo_span_renderer_create_in_error (status);
 }
 
-static cairo_bool_t
+cairo_private cairo_bool_t
 _cairo_gl_surface_get_extents (void		     *abstract_surface,
 			       cairo_rectangle_int_t *rectangle)
 {
@@ -1695,12 +1695,13 @@ _cairo_gl_surface_stroke (void			        *abstract_surface,
 {
     cairo_gl_surface_t *surface = abstract_surface;
     cairo_composite_rectangles_t extents;
+    cairo_rectangle_int_t unbounded;
     cairo_polygon_t polygon;
     cairo_status_t status;
 
+    _cairo_gl_surface_get_extents (surface, &unbounded);
     status = _cairo_composite_rectangles_init_for_stroke (&extents,
-							  surface->width,
-							  surface->height,
+							  &unbounded,
 							  op, source,
 							  path, style, ctm,
 							  clip);
@@ -1737,12 +1738,13 @@ _cairo_gl_surface_fill (void			*abstract_surface,
 {
     cairo_gl_surface_t *surface = abstract_surface;
     cairo_composite_rectangles_t extents;
+    cairo_rectangle_int_t unbounded;
     cairo_polygon_t polygon;
     cairo_status_t status;
 
+    _cairo_gl_surface_get_extents (surface, &unbounded);
     status = _cairo_composite_rectangles_init_for_fill (&extents,
-							surface->width,
-							surface->height,
+							&unbounded,
 							op, source, path,
 							clip);
     if (unlikely (status))
-- 
1.7.6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.