diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-11-06 10:21:48 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2014-11-06 12:24:43 +0100 |
commit | 90a5fa80af4e826b1b89175f499d9e6b05b7c32e (patch) | |
tree | a19c264dc4a9396f2f5d8755f3a6f6f651433bdb /gdk/gdkgl.c | |
parent | 7fde5213b011782c692d2d18f52649a463307166 (diff) | |
download | gtk+-90a5fa80af4e826b1b89175f499d9e6b05b7c32e.tar.gz |
Add GDK_GL env var and GdkGLFlags
This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always.
It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG
is really only about debug loggin.
It also adds some completely new flags:
software-draw-gl:
Always use software fallback for drawing gl content to a cairo_t.
This disables the fastpaths that exist for drawing directly to
a window and instead reads back the pixels into a cairo image
surface.
software-draw-surface:
Always use software fallback for drawing cairo surfaces onto a
gl-using window. This disables e.g. texture-from-pixmap on X11.
software-draw:
Enables both the above.
Diffstat (limited to 'gdk/gdkgl.c')
-rw-r--r-- | gdk/gdkgl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index 3a6d2814ed..44d205edf0 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -335,7 +335,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr, /* For direct paint of non-alpha renderbuffer, we can just do a bitblit */ - if (source_type == GL_RENDERBUFFER && + if ((_gdk_gl_flags & GDK_GL_FLAGS_SOFTWARE_DRAW_GL) == 0 && + source_type == GL_RENDERBUFFER && alpha_size == 0 && direct_window != NULL && direct_window->current_paint.use_gl && @@ -415,7 +416,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr, } /* For direct paint of alpha or non-alpha textures we can use texturing */ - else if (source_type == GL_TEXTURE && + else if ((_gdk_gl_flags & GDK_GL_FLAGS_SOFTWARE_DRAW_GL) == 0 && + source_type == GL_TEXTURE && direct_window != NULL && direct_window->current_paint.use_gl && trivial_transform && @@ -602,7 +604,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, guint target; paint_context = gdk_gl_context_get_current (); - if (paint_context && + if ((_gdk_gl_flags & GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE) == 0 && + paint_context && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region)) return; |