mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl: Use pixel_format_to_gl_with_target in find_best_gl_get_data_format
Fixes cogl_texture_get_data() resorting to the wrong conversions when extracting the texture data. This notably resulted in RGB/RGBA buffers copied as-is into BGRA buffers, for instance for the fullscreen animation, or single-window screenshots of such buffers. https://bugzilla.gnome.org/show_bug.cgi?id=779234
This commit is contained in:
parent
fe5138dfc4
commit
374bb630f0
@ -198,6 +198,7 @@ struct _CoglTextureDriver
|
||||
CoglPixelFormat
|
||||
(* find_best_gl_get_data_format) (CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type);
|
||||
};
|
||||
|
@ -1059,6 +1059,7 @@ cogl_texture_get_data (CoglTexture *texture,
|
||||
|
||||
closest_format =
|
||||
ctx->texture_driver->find_best_gl_get_data_format (ctx,
|
||||
texture_format,
|
||||
format,
|
||||
&closest_gl_format,
|
||||
&closest_gl_type);
|
||||
|
@ -533,14 +533,16 @@ static CoglPixelFormat
|
||||
_cogl_texture_driver_find_best_gl_get_data_format
|
||||
(CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type)
|
||||
{
|
||||
return context->driver_vtable->pixel_format_to_gl (context,
|
||||
format,
|
||||
NULL, /* don't need */
|
||||
closest_gl_format,
|
||||
closest_gl_type);
|
||||
return context->driver_vtable->pixel_format_to_gl_with_target (context,
|
||||
format,
|
||||
target_format,
|
||||
NULL, /* don't need */
|
||||
closest_gl_format,
|
||||
closest_gl_type);
|
||||
}
|
||||
|
||||
const CoglTextureDriver
|
||||
|
@ -615,6 +615,7 @@ static CoglPixelFormat
|
||||
_cogl_texture_driver_find_best_gl_get_data_format
|
||||
(CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user