diff --git a/cogl/cogl/cogl-atlas-texture.c b/cogl/cogl/cogl-atlas-texture.c index 5f1f644b4..5627e8bd8 100644 --- a/cogl/cogl/cogl-atlas-texture.c +++ b/cogl/cogl/cogl-atlas-texture.c @@ -519,7 +519,6 @@ static CoglBitmap * _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex, CoglBitmap *bmp, CoglPixelFormat internal_format, - gboolean can_convert_in_place, GError **error) { CoglBitmap *upload_bmp; @@ -538,7 +537,6 @@ _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex, upload_bmp = _cogl_bitmap_convert_for_upload (bmp, internal_format, - can_convert_in_place, error); if (upload_bmp == NULL) return NULL; @@ -586,8 +584,6 @@ _cogl_atlas_texture_set_region (CoglTexture *tex, _cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex, bmp, atlas_tex->internal_format, - FALSE, /* can't convert - in place */ error); if (!upload_bmp) return FALSE; @@ -816,7 +812,6 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex, CoglPixelFormat bmp_format = cogl_bitmap_get_format (bmp); int width = cogl_bitmap_get_width (bmp); int height = cogl_bitmap_get_height (bmp); - gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place; CoglPixelFormat internal_format; CoglBitmap *upload_bmp; @@ -828,7 +823,6 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex, _cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex, bmp, internal_format, - can_convert_in_place, error); if (upload_bmp == NULL) return FALSE; @@ -899,7 +893,6 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp) loader = _cogl_texture_create_loader (); loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP; loader->src.bitmap.bitmap = cogl_object_ref (bmp); - loader->src.bitmap.can_convert_in_place = FALSE; return _cogl_atlas_texture_create_base (_cogl_bitmap_get_context (bmp), cogl_bitmap_get_width (bmp), diff --git a/cogl/cogl/cogl-bitmap-conversion.c b/cogl/cogl/cogl-bitmap-conversion.c index 045393fa0..1c7bc378a 100644 --- a/cogl/cogl/cogl-bitmap-conversion.c +++ b/cogl/cogl/cogl-bitmap-conversion.c @@ -566,7 +566,6 @@ driver_can_convert (CoglContext *ctx, CoglBitmap * _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp, CoglPixelFormat internal_format, - gboolean can_convert_in_place, GError **error) { CoglContext *ctx = _cogl_bitmap_get_context (src_bmp); @@ -590,26 +589,11 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp, if (_cogl_texture_needs_premult_conversion (src_format, internal_format)) { - if (can_convert_in_place) - { - if (_cogl_bitmap_convert_premult_status (src_bmp, - (src_format ^ - COGL_PREMULT_BIT), - error)) - { - dst_bmp = cogl_object_ref (src_bmp); - } - else - return NULL; - } - else - { - dst_bmp = _cogl_bitmap_convert (src_bmp, - src_format ^ COGL_PREMULT_BIT, - error); - if (dst_bmp == NULL) - return NULL; - } + dst_bmp = _cogl_bitmap_convert (src_bmp, + src_format ^ COGL_PREMULT_BIT, + error); + if (dst_bmp == NULL) + return NULL; } else dst_bmp = cogl_object_ref (src_bmp); diff --git a/cogl/cogl/cogl-bitmap-private.h b/cogl/cogl/cogl-bitmap-private.h index 31a259a34..acbd41e04 100644 --- a/cogl/cogl/cogl-bitmap-private.h +++ b/cogl/cogl/cogl-bitmap-private.h @@ -105,7 +105,6 @@ _cogl_bitmap_convert (CoglBitmap *bmp, CoglBitmap * _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp, CoglPixelFormat internal_format, - gboolean can_convert_in_place, GError **error); gboolean diff --git a/cogl/cogl/cogl-texture-2d-sliced.c b/cogl/cogl/cogl-texture-2d-sliced.c index d179b8659..84c3b8dc0 100644 --- a/cogl/cogl/cogl-texture-2d-sliced.c +++ b/cogl/cogl/cogl-texture-2d-sliced.c @@ -896,7 +896,6 @@ cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp, loader = _cogl_texture_create_loader (); loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP; loader->src.bitmap.bitmap = cogl_object_ref (bmp); - loader->src.bitmap.can_convert_in_place = FALSE; return _cogl_texture_2d_sliced_create_base (_cogl_bitmap_get_context (bmp), cogl_bitmap_get_width (bmp), @@ -987,7 +986,6 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds, CoglBitmap *bmp = loader->src.bitmap.bitmap; int width = cogl_bitmap_get_width (bmp); int height = cogl_bitmap_get_height (bmp); - gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place; CoglPixelFormat internal_format; CoglBitmap *upload_bmp; @@ -999,7 +997,6 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds, upload_bmp = _cogl_bitmap_convert_for_upload (bmp, internal_format, - can_convert_in_place, error); if (upload_bmp == NULL) return FALSE; @@ -1249,8 +1246,6 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex, upload_bmp = _cogl_bitmap_convert_for_upload (bmp, _cogl_texture_get_format (tex), - FALSE, /* can't convert in - place */ error); if (!upload_bmp) return FALSE; diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index 30b6098db..b58a54b85 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -169,7 +169,6 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp) loader = _cogl_texture_create_loader (); loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP; loader->src.bitmap.bitmap = cogl_object_ref (bmp); - loader->src.bitmap.can_convert_in_place = FALSE; return _cogl_texture_2d_create_base (_cogl_bitmap_get_context (bmp), cogl_bitmap_get_width (bmp), diff --git a/cogl/cogl/cogl-texture-private.h b/cogl/cogl/cogl-texture-private.h index a512ed9e1..f63fa5709 100644 --- a/cogl/cogl/cogl-texture-private.h +++ b/cogl/cogl/cogl-texture-private.h @@ -170,7 +170,6 @@ typedef struct _CoglTextureLoader CoglBitmap *bitmap; int height; /* for 3d textures */ int depth; /* for 3d textures */ - gboolean can_convert_in_place; } bitmap; #if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base) struct { diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c index 6ba1092df..ed6762b3f 100644 --- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c @@ -197,7 +197,6 @@ allocate_from_bitmap (CoglTexture2D *tex_2d, CoglPixelFormat internal_format; int width = cogl_bitmap_get_width (bmp); int height = cogl_bitmap_get_height (bmp); - gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place; CoglBitmap *upload_bmp; GLenum gl_intformat; GLenum gl_format; @@ -220,7 +219,6 @@ allocate_from_bitmap (CoglTexture2D *tex_2d, upload_bmp = _cogl_bitmap_convert_for_upload (bmp, internal_format, - can_convert_in_place, error); if (upload_bmp == NULL) return FALSE; @@ -577,7 +575,6 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d, upload_bmp = _cogl_bitmap_convert_for_upload (bmp, _cogl_texture_get_format (tex), - FALSE, /* can't convert in place */ error); if (upload_bmp == NULL) return FALSE;