[mutter] cogl: Use pixel_format_to_gl_with_target on bitmap uploading paths



commit 35388fb33cb39a311b4ccc504ac15a6c5d226dab
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Mar 3 17:13:10 2017 +0100

    cogl: Use pixel_format_to_gl_with_target on bitmap uploading paths
    
    We already do have a texture with an internal format in these paths,
    so we should check the required format according to it.
    
    This fixes CoglAtlasTexture (and CoglPangoRenderer indirectly), as
    it forces a RGBA format on its texture, but pixel_format_to_gl()
    anyway assumed swizzling is performed on the texture, while it is
    not the case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779234

 cogl/cogl/driver/gl/cogl-texture-2d-gl.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
index 375edcb..d1eff45 100644
--- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
+++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
@@ -772,11 +772,12 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
 
   upload_format = cogl_bitmap_get_format (upload_bmp);
 
-  ctx->driver_vtable->pixel_format_to_gl (ctx,
-                                          upload_format,
-                                          NULL, /* internal format */
-                                          &gl_format,
-                                          &gl_type);
+  ctx->driver_vtable->pixel_format_to_gl_with_target (ctx,
+                                                      upload_format,
+                                                      _cogl_texture_get_format (tex),
+                                                      NULL, /* internal gl format */
+                                                      &gl_format,
+                                                      &gl_type);
 
   /* If this touches the first pixel then we'll update our copy */
   if (dst_x == 0 && dst_y == 0 &&


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