[gtk+/wip/matthiasc/glyph-cache: 4/5] vulkan: pass the context when creating a glyph cache



commit 5b8588e413d88d50253528a39f05c982f3b7402c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Sep 20 10:01:58 2017 -0400

    vulkan: pass the context when creating a glyph cache

 gsk/gskvulkanglyphcache.c        |   11 +++++++++--
 gsk/gskvulkanglyphcacheprivate.h |    2 +-
 gsk/gskvulkanrenderer.c          |    2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gskvulkanglyphcache.c b/gsk/gskvulkanglyphcache.c
index 69181f6..bd5756d 100644
--- a/gsk/gskvulkanglyphcache.c
+++ b/gsk/gskvulkanglyphcache.c
@@ -19,6 +19,8 @@ typedef struct {
 struct _GskVulkanGlyphCache {
   GObject parent_instance;
 
+  GdkVulkanContext *vulkan;
+
   GHashTable *hash_table;
   GPtrArray *atlases;
 };
@@ -224,9 +226,14 @@ add_to_cache (GskVulkanGlyphCache  *cache,
 }
 
 GskVulkanGlyphCache *
-gsk_vulkan_glyph_cache_new (void)
+gsk_vulkan_glyph_cache_new (GdkVulkanContext *vulkan)
 {
-  return GSK_VULKAN_GLYPH_CACHE (g_object_new (GSK_TYPE_VULKAN_GLYPH_CACHE, NULL));
+  GskVulkanGlyphCache *cache;
+
+  cache = GSK_VULKAN_GLYPH_CACHE (g_object_new (GSK_TYPE_VULKAN_GLYPH_CACHE, NULL));
+  cache->vulkan = vulkan;
+
+  return cache;
 }
 
 GskVulkanCachedGlyph *
diff --git a/gsk/gskvulkanglyphcacheprivate.h b/gsk/gskvulkanglyphcacheprivate.h
index 9c2e61f..5686685 100644
--- a/gsk/gskvulkanglyphcacheprivate.h
+++ b/gsk/gskvulkanglyphcacheprivate.h
@@ -11,7 +11,7 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE(GskVulkanGlyphCache, gsk_vulkan_glyph_cache, GSK, VULKAN_GLYPH_CACHE, GObject)
 
-GskVulkanGlyphCache  *gsk_vulkan_glyph_cache_new            (void);
+GskVulkanGlyphCache  *gsk_vulkan_glyph_cache_new            (GdkVulkanContext *vulkan);
 
 GskVulkanImage *     gsk_vulkan_glyph_cache_get_glyph_image (GskVulkanGlyphCache *cache,
                                                              GskVulkanUploader   *uploader,
diff --git a/gsk/gskvulkanrenderer.c b/gsk/gskvulkanrenderer.c
index bc70983..6c8c45d 100644
--- a/gsk/gskvulkanrenderer.c
+++ b/gsk/gskvulkanrenderer.c
@@ -137,7 +137,7 @@ gsk_vulkan_renderer_realize (GskRenderer  *renderer,
 
   self->render = gsk_vulkan_render_new (renderer, self->vulkan);
 
-  self->glyph_cache = gsk_vulkan_glyph_cache_new ();
+  self->glyph_cache = gsk_vulkan_glyph_cache_new (self->vulkan);
 
   return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]