[cairo] [PATCH v8 52/71] drm/intel: make struct _intel_glyph container of cairo_scaled_glyph_private_t

Enrico Weigelt, metux IT consult enrico.weigelt at gr13.net
Thu Jun 30 15:46:30 UTC 2016


Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
---
 src/drm/cairo-drm-intel-private.h |  1 +
 src/drm/cairo-drm-intel.c         | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/drm/cairo-drm-intel-private.h b/src/drm/cairo-drm-intel-private.h
index e643e82..a351367 100644
--- a/src/drm/cairo-drm-intel-private.h
+++ b/src/drm/cairo-drm-intel-private.h
@@ -159,6 +159,7 @@ typedef struct _intel_buffer_cache {
 
 typedef struct _intel_glyph {
     cairo_rtree_node_t node;
+    cairo_scaled_glyph_private_t base;
     cairo_scaled_glyph_t *glyph;
     intel_buffer_cache_t *cache;
     void **owner;
diff --git a/src/drm/cairo-drm-intel.c b/src/drm/cairo-drm-intel.c
index 609875a..8d9415e 100644
--- a/src/drm/cairo-drm-intel.c
+++ b/src/drm/cairo-drm-intel.c
@@ -873,12 +873,15 @@ intel_glyph_cache_add_glyph (intel_device_t *device,
 	return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
     }
 
-    scaled_glyph->surface_private = node;
-
     glyph_private= (intel_glyph_t *) node;
     glyph_private->cache = cache;
     glyph_private->glyph = scaled_glyph;
 
+    _cairo_scaled_glyph_attach_private (scaled_glyph,
+					&glyph_private->base,
+					cache,
+					intel_scaled_glyph_fini);
+
     scaled_glyph->dev_private = glyph_private;
     scaled_glyph->dev_private_key = cache;
 
@@ -906,7 +909,9 @@ intel_scaled_glyph_fini (cairo_scaled_glyph_private_t *scaled_glyph_private,
 			 cairo_scaled_glyph_t         *scaled_glyph,
 			 cairo_scaled_font_t          *scaled_font)
 {
-    intel_glyph_t *priv = scaled_glyph->surface_private;
+    intel_glyph_t *priv = cairo_container_of(scaled_glyph_private,
+					     intel_glyph_t,
+					     base);
 
     /* XXX thread-safety? Probably ok due to the frozen scaled-font. */
     if (! priv->node.pinned)
-- 
2.6.4.442.g545299f



More information about the cairo mailing list