[gtk+/wip/ebassi/gles] x11: Do not use GLX_EXT_texture_from_pixmap on OpenGL ES
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gles] x11: Do not use GLX_EXT_texture_from_pixmap on OpenGL ES
- Date: Mon, 25 Apr 2016 12:40:37 +0000 (UTC)
commit 7da0f6c0e79e4cd86cc9c77ba6a9843d0977a00d
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Apr 25 13:38:22 2016 +0100
x11: Do not use GLX_EXT_texture_from_pixmap on OpenGL ES
The internal representation of the texture data does not require the
color channel flip we use in the shader.
We can live with a single copy, but the proper way to fix the issue
would be to have a separate uniform value in the GLES fragment shader
that gets toggled at paint time when drawing the texture quad.
gdk/x11/gdkglcontext-x11.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 596d37a..2e55c3a 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -438,6 +438,9 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
GdkTexturedQuad *quads;
GdkX11Display *display_x11;
+ if (gdk_gl_context_get_use_es (paint_context))
+ return FALSE;
+
display_x11 = GDK_X11_DISPLAY (gdk_gl_context_get_display (paint_context));
if (!display_x11->has_glx_texture_from_pixmap)
return FALSE;
@@ -455,15 +458,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();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]