vulkan: pass the context when creating a glyph cache

This commit is contained in:
Matthias Clasen
2017-09-20 10:01:58 -04:00
parent 5ee5af9bc8
commit 7bbd4d41e0
3 changed files with 11 additions and 4 deletions

View File

@@ -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 *

View File

@@ -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,

View File

@@ -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;
}