[cairo] [PATCH 34/43] drm/intel: make struct _intel_glyph container of cairo_scaled_glyph_private_t
Enrico Weigelt, metux IT consult
enrico.weigelt at gr13.net
Tue Dec 15 11:50:14 PST 2015
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 08dc058..b9b9cfe 100644
--- a/src/drm/cairo-drm-intel-private.h
+++ b/src/drm/cairo-drm-intel-private.h
@@ -160,6 +160,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 9a04c44..665922a 100644
--- a/src/drm/cairo-drm-intel.c
+++ b/src/drm/cairo-drm-intel.c
@@ -938,12 +938,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;
@@ -971,7 +974,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