diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-03-03 17:13:10 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-03-07 13:40:06 +0100 |
commit | 35388fb33cb39a311b4ccc504ac15a6c5d226dab (patch) | |
tree | f41095b8d64d2d5f681c9763c4df9365563f8b31 /cogl | |
parent | aa5738c777883f270ae9cb3b2988d194792fed75 (diff) | |
download | mutter-35388fb33cb39a311b4ccc504ac15a6c5d226dab.tar.gz |
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
Diffstat (limited to 'cogl')
-rw-r--r-- | 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 375edcb14..d1eff4507 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 && |