diff --git a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c index 8ae631df6..abff84ee0 100644 --- a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c +++ b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c @@ -1412,22 +1412,12 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer, if (!cogl_is_offscreen (framebuffer)) y = framebuffer_height - y - height; - required_format = ctx->driver_vtable->pixel_format_to_gl (ctx, - format, - &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 ((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 + required_format = ctx->driver_vtable->pixel_format_to_gl_with_target (ctx, + framebuffer->internal_format, + format, + &gl_intformat, + &gl_format, + &gl_type); /* NB: All offscreen rendering is done upside down so there is no need * to flip in this case... */