mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 00:50:42 -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
7f0f880fba
commit
1b4cd1b47d
@ -198,6 +198,7 @@ struct _CoglTextureDriver
|
|||||||
CoglPixelFormat
|
CoglPixelFormat
|
||||||
(* find_best_gl_get_data_format) (CoglContext *context,
|
(* find_best_gl_get_data_format) (CoglContext *context,
|
||||||
CoglPixelFormat format,
|
CoglPixelFormat format,
|
||||||
|
CoglPixelFormat target_format,
|
||||||
GLenum *closest_gl_format,
|
GLenum *closest_gl_format,
|
||||||
GLenum *closest_gl_type);
|
GLenum *closest_gl_type);
|
||||||
};
|
};
|
||||||
|
@ -1059,6 +1059,7 @@ cogl_texture_get_data (CoglTexture *texture,
|
|||||||
|
|
||||||
closest_format =
|
closest_format =
|
||||||
ctx->texture_driver->find_best_gl_get_data_format (ctx,
|
ctx->texture_driver->find_best_gl_get_data_format (ctx,
|
||||||
|
texture_format,
|
||||||
format,
|
format,
|
||||||
&closest_gl_format,
|
&closest_gl_format,
|
||||||
&closest_gl_type);
|
&closest_gl_type);
|
||||||
|
@ -533,11 +533,13 @@ static CoglPixelFormat
|
|||||||
_cogl_texture_driver_find_best_gl_get_data_format
|
_cogl_texture_driver_find_best_gl_get_data_format
|
||||||
(CoglContext *context,
|
(CoglContext *context,
|
||||||
CoglPixelFormat format,
|
CoglPixelFormat format,
|
||||||
|
CoglPixelFormat target_format,
|
||||||
GLenum *closest_gl_format,
|
GLenum *closest_gl_format,
|
||||||
GLenum *closest_gl_type)
|
GLenum *closest_gl_type)
|
||||||
{
|
{
|
||||||
return context->driver_vtable->pixel_format_to_gl (context,
|
return context->driver_vtable->pixel_format_to_gl_with_target (context,
|
||||||
format,
|
format,
|
||||||
|
target_format,
|
||||||
NULL, /* don't need */
|
NULL, /* don't need */
|
||||||
closest_gl_format,
|
closest_gl_format,
|
||||||
closest_gl_type);
|
closest_gl_type);
|
||||||
|
@ -615,6 +615,7 @@ static CoglPixelFormat
|
|||||||
_cogl_texture_driver_find_best_gl_get_data_format
|
_cogl_texture_driver_find_best_gl_get_data_format
|
||||||
(CoglContext *context,
|
(CoglContext *context,
|
||||||
CoglPixelFormat format,
|
CoglPixelFormat format,
|
||||||
|
CoglPixelFormat target_format,
|
||||||
GLenum *closest_gl_format,
|
GLenum *closest_gl_format,
|
||||||
GLenum *closest_gl_type)
|
GLenum *closest_gl_type)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user