[gtk/matthiasc/color-profiles: 102/111] ngl: Fix caching for GL textures
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/color-profiles: 102/111] ngl: Fix caching for GL textures
- Date: Wed, 6 Oct 2021 06:20:01 +0000 (UTC)
commit 5898e922a106ee88b2e156118ca10739c28ddd11
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 2 13:33:17 2021 -0400
ngl: Fix caching for GL textures
Now that GL textures can have render data,
we need to check for that first.
gsk/ngl/gskngldriver.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/gsk/ngl/gskngldriver.c b/gsk/ngl/gskngldriver.c
index e791ced04c..2393c29f75 100644
--- a/gsk/ngl/gskngldriver.c
+++ b/gsk/ngl/gskngldriver.c
@@ -831,6 +831,12 @@ gsk_ngl_driver_load_texture (GskNglDriver *self,
format = GL_RGBA8;
+ if ((t = gdk_texture_get_render_data (texture, self)))
+ {
+ if (t->min_filter == min_filter && t->mag_filter == mag_filter)
+ return t->texture_id;
+ }
+
if (GDK_IS_GL_TEXTURE (texture))
{
GdkGLTexture *gl_texture = (GdkGLTexture *) texture;
@@ -899,23 +905,9 @@ gsk_ngl_driver_load_texture (GskNglDriver *self,
return texture_id;
}
}
- else
- {
- downloaded_texture = gdk_texture_download_texture (texture);
- }
- }
- else
- {
- if ((t = gdk_texture_get_render_data (texture, self)))
- {
- if (t->min_filter == min_filter && t->mag_filter == mag_filter)
- return t->texture_id;
- }
-
- downloaded_texture = gdk_texture_download_texture (texture);
}
- g_assert (downloaded_texture && !texture_id);
+ downloaded_texture = gdk_texture_download_texture (texture);
/* The download_texture() call may have switched the GL context. Make sure
* the right context is at work again. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]