summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkglcontext-x11.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-04-25 13:38:22 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2016-04-25 14:33:36 +0100
commitf848450a70931133ab9368fd35b629c6c6e50fcb (patch)
tree648dbd35a3e44a168fa92f6d548639cb8e160bb9 /gdk/x11/gdkglcontext-x11.c
parent1379b4b175910a253bb4aa8df3194eec2e160213 (diff)
downloadgtk+-f848450a70931133ab9368fd35b629c6c6e50fcb.tar.gz
gl: Use a uniform to flip R and B colors on GLES
This allows us to decide when the R and B color channels should be flipped with a much better granularity. For instance, when using GLX_EXT_texture_from_pixmap to create a GL texture from a surface we don't need to swap the R and B channels, as the internal representation of the texture data will already have the appropriate colors. We also don't need to flip color channels when blitting from a texture.
Diffstat (limited to 'gdk/x11/gdkglcontext-x11.c')
-rw-r--r--gdk/x11/gdkglcontext-x11.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 596d37a35e..0819f89648 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -455,15 +455,15 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
if (glx_pixmap == NULL)
return FALSE;
+ GDK_NOTE (OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface"));
+
window = gdk_gl_context_get_window (paint_context)->impl_window;
window_scale = gdk_window_get_scale_factor (window);
gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height);
sx = sy = 1;
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
-
- cairo_surface_get_device_offset (surface,
- &device_x_offset, &device_y_offset);
+ cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset);
/* Ensure all the X stuff are synced before we read it back via texture-from-pixmap */
glXWaitX();
@@ -526,7 +526,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
#undef FLIP_Y
- gdk_gl_texture_quads (paint_context, target, n_rects, quads);
+ gdk_gl_texture_quads (paint_context, target, n_rects, quads, FALSE);
g_free (quads);
glDisable (GL_SCISSOR_TEST);