[mutter] cogl: Only do the swizzling hack for GL contexts



commit 483ed9877756e394c84da00760e35ffb83ed50cd
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Mon Aug 21 13:29:25 2017 +0200

    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

 cogl/cogl/driver/gl/cogl-framebuffer-gl.c |    6 ++++--
 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 2af36f0..8ae631d 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... */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]