From 762b981dfe1fff8d1edb548276522a07d8b72200 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 22 Jul 2024 01:18:44 +0200 Subject: [PATCH] gpu: Make the device queryable from the cache That's needed in cached subclasses during destruction, when they want to destroy system resources. --- gsk/gpu/gskgpucache.c | 6 ++++++ gsk/gpu/gskgpucacheprivate.h | 1 + 2 files changed, 7 insertions(+) diff --git a/gsk/gpu/gskgpucache.c b/gsk/gpu/gskgpucache.c index 1c02d3a50a..590b464192 100644 --- a/gsk/gpu/gskgpucache.c +++ b/gsk/gpu/gskgpucache.c @@ -785,6 +785,12 @@ static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS = /* }}} */ /* {{{ GskGpuCache */ +GskGpuDevice * +gsk_gpu_cache_get_device (GskGpuCache *self) +{ + return self->device; +} + /* * gsk_gpu_cache_set_time: * @self: a `GskGpuCache` diff --git a/gsk/gpu/gskgpucacheprivate.h b/gsk/gpu/gskgpucacheprivate.h index e4e23e51b5..aa7ce2764c 100644 --- a/gsk/gpu/gskgpucacheprivate.h +++ b/gsk/gpu/gskgpucacheprivate.h @@ -57,6 +57,7 @@ GskGpuCache * gsk_gpu_cache_new (GskGpuD gpointer gsk_gpu_cached_new (GskGpuCache *cache, const GskGpuCachedClass *class); +GskGpuDevice * gsk_gpu_cache_get_device (GskGpuCache *self); void gsk_gpu_cache_set_time (GskGpuCache *self, gint64 timestamp);