cogl/texture: Make is_get_data_supported() a bool on the texture

Comparing the gl target is not enough. More on that later.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/687
This commit is contained in:
Jonas Ådahl 2019-07-16 18:27:38 +02:00 committed by Georges Basile Stavracas Neto
parent ac5d9ec558
commit e6c8939c30
3 changed files with 4 additions and 4 deletions

View File

@ -47,6 +47,7 @@ struct _CoglTexture2D
gboolean auto_mipmap; gboolean auto_mipmap;
gboolean mipmaps_dirty; gboolean mipmaps_dirty;
gboolean is_foreign; gboolean is_foreign;
gboolean is_get_data_supported;
/* TODO: factor out these OpenGL specific members into some form /* TODO: factor out these OpenGL specific members into some form
* of driver private state. */ * of driver private state. */

View File

@ -106,6 +106,7 @@ _cogl_texture_2d_create_base (CoglContext *ctx,
tex_2d->mipmaps_dirty = TRUE; tex_2d->mipmaps_dirty = TRUE;
tex_2d->auto_mipmap = TRUE; tex_2d->auto_mipmap = TRUE;
tex_2d->is_get_data_supported = TRUE;
tex_2d->gl_target = GL_TEXTURE_2D; tex_2d->gl_target = GL_TEXTURE_2D;

View File

@ -508,6 +508,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
tex_2d->internal_format = internal_format; tex_2d->internal_format = internal_format;
tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES; tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES;
tex_2d->is_get_data_supported = FALSE;
return TRUE; return TRUE;
} }
@ -834,10 +835,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
gboolean gboolean
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d) _cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d)
{ {
if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES) return tex_2d->is_get_data_supported;
return FALSE;
else
return TRUE;
} }
void void