summaryrefslogtreecommitdiff
path: root/cogl
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@endlessm.com>2017-08-21 13:29:25 +0200
committerMario Sanchez Prada <mario@endlessm.com>2017-08-21 16:29:39 +0200
commit483ed9877756e394c84da00760e35ffb83ed50cd (patch)
treefeac78617215aaa03c427729de3113029ee36269 /cogl
parent14fe6e9c95c5bc6784462131d525500ed99663ec (diff)
downloadmutter-483ed9877756e394c84da00760e35ffb83ed50cd.tar.gz
cogl: Only do the swizzling hack for GL contexts
The GL_BGRA definition is not available for GLES2 contexts, which use the EXT_texture_format_BGRA8888 instead, causing a build failure when trying to use it in those contexts. Fortunately, this hack is only relevant for GL, so let's guard it to prevent the failure in GLES2, where that extension is used instead. https://bugzilla.gnome.org/show_bug.cgi?id=786568
Diffstat (limited to 'cogl')
-rw-r--r--cogl/cogl/driver/gl/cogl-framebuffer-gl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
index 2af36f0bc..8ae631df6 100644
--- a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -1417,15 +1417,17 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
&gl_intformat,
&gl_format,
&gl_type);
-
+#if HAVE_COGL_GL
/* As we are reading pixels, we want to consider the bitmap according to
* its real pixel format, not the swizzled channels we pretend face to the
* pipeline.
*/
- if ((format == COGL_PIXEL_FORMAT_BGRA_8888 ||
+ if ((ctx->driver == COGL_DRIVER_GL || ctx->driver == COGL_DRIVER_GL3) &&
+ (format == COGL_PIXEL_FORMAT_BGRA_8888 ||
format == COGL_PIXEL_FORMAT_BGRA_8888_PRE) &&
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
gl_format = GL_BGRA;
+#endif
/* NB: All offscreen rendering is done upside down so there is no need
* to flip in this case... */