[gtk/matthiasc/color-profiles: 25/32] ngl: Fix caching for GL textures
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/color-profiles: 25/32] ngl: Fix caching for GL textures
- Date: Sun, 3 Oct 2021 20:23:26 +0000 (UTC)
commit 193bc0859901e319c6f344c0b554221718a76279
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 8d23f9244b..721705ffab 100644
--- a/gsk/ngl/gskngldriver.c
+++ b/gsk/ngl/gskngldriver.c
@@ -822,6 +822,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;
@@ -890,23 +896,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]