[gtk+] gdk_gl_texture_from_surface - fix software fallback
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk_gl_texture_from_surface - fix software fallback
- Date: Mon, 15 Dec 2014 20:58:12 +0000 (UTC)
commit 2693496b56092cba65a49fb6f4199f5efbd5e5e2
Author: Alexander Larsson <alexl redhat com>
Date: Mon Dec 15 21:55:10 2014 +0100
gdk_gl_texture_from_surface - fix software fallback
We can't combine multiple draws into one for the software fallback,
because each quad has a different texture. And we generally don't
want to make a larger single texture because then we would have
to upload more data.
gdk/gdkgl.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index 2c554bf..67fafab 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -664,7 +664,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
float umax, vmax;
gboolean use_texture_rectangle;
guint target;
- GdkTexturedQuad *quads;
paint_context = gdk_gl_context_get_current ();
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
@@ -702,7 +701,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
glTexParameteri (target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
n_rects = cairo_region_num_rectangles (region);
- quads = g_new (GdkTexturedQuad, n_rects);
for (i = 0; i < n_rects; i++)
{
@@ -749,12 +747,12 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
umax, vmax,
};
- quads[i] = quad;
+ /* We don't want to combine the quads here, because they have different textures.
+ * And we don't want to upload the unused source areas to make it one texture. */
+ gdk_gl_texture_quads (paint_context, target, 1, &quad);
}
}
- gdk_gl_texture_quads (paint_context, target, n_rects, quads);
- g_free (quads);
glDisable (GL_SCISSOR_TEST);
glDisable (target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]