diff --git a/cogl/cogl/cogl-texture-2d-private.h b/cogl/cogl/cogl-texture-2d-private.h index 450d156f1..c1e6dff50 100644 --- a/cogl/cogl/cogl-texture-2d-private.h +++ b/cogl/cogl/cogl-texture-2d-private.h @@ -47,6 +47,7 @@ struct _CoglTexture2D gboolean auto_mipmap; gboolean mipmaps_dirty; gboolean is_foreign; + gboolean is_get_data_supported; /* TODO: factor out these OpenGL specific members into some form * of driver private state. */ diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index 05cfff42a..c5b44bf97 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -106,6 +106,7 @@ _cogl_texture_2d_create_base (CoglContext *ctx, tex_2d->mipmaps_dirty = TRUE; tex_2d->auto_mipmap = TRUE; + tex_2d->is_get_data_supported = TRUE; tex_2d->gl_target = GL_TEXTURE_2D; diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c index 57d40f3a3..08f8b263c 100644 --- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c @@ -508,6 +508,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d, tex_2d->internal_format = internal_format; tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES; + tex_2d->is_get_data_supported = FALSE; return TRUE; } @@ -834,10 +835,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d, gboolean _cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d) { - if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES) - return FALSE; - else - return TRUE; + return tex_2d->is_get_data_supported; } void