mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
cogl: Drop can_convert_in_place from TextureLoader
As nothing really sets it (see previous commits) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3097>
This commit is contained in:
parent
d492dc7687
commit
b78951ad09
@ -519,7 +519,6 @@ static CoglBitmap *
|
|||||||
_cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
|
_cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
|
||||||
CoglBitmap *bmp,
|
CoglBitmap *bmp,
|
||||||
CoglPixelFormat internal_format,
|
CoglPixelFormat internal_format,
|
||||||
gboolean can_convert_in_place,
|
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
CoglBitmap *upload_bmp;
|
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,
|
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
||||||
internal_format,
|
internal_format,
|
||||||
can_convert_in_place,
|
|
||||||
error);
|
error);
|
||||||
if (upload_bmp == NULL)
|
if (upload_bmp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -586,8 +584,6 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
|
|||||||
_cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex,
|
_cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex,
|
||||||
bmp,
|
bmp,
|
||||||
atlas_tex->internal_format,
|
atlas_tex->internal_format,
|
||||||
FALSE, /* can't convert
|
|
||||||
in place */
|
|
||||||
error);
|
error);
|
||||||
if (!upload_bmp)
|
if (!upload_bmp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -816,7 +812,6 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
|
|||||||
CoglPixelFormat bmp_format = cogl_bitmap_get_format (bmp);
|
CoglPixelFormat bmp_format = cogl_bitmap_get_format (bmp);
|
||||||
int width = cogl_bitmap_get_width (bmp);
|
int width = cogl_bitmap_get_width (bmp);
|
||||||
int height = cogl_bitmap_get_height (bmp);
|
int height = cogl_bitmap_get_height (bmp);
|
||||||
gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place;
|
|
||||||
CoglPixelFormat internal_format;
|
CoglPixelFormat internal_format;
|
||||||
CoglBitmap *upload_bmp;
|
CoglBitmap *upload_bmp;
|
||||||
|
|
||||||
@ -828,7 +823,6 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
|
|||||||
_cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex,
|
_cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex,
|
||||||
bmp,
|
bmp,
|
||||||
internal_format,
|
internal_format,
|
||||||
can_convert_in_place,
|
|
||||||
error);
|
error);
|
||||||
if (upload_bmp == NULL)
|
if (upload_bmp == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -899,7 +893,6 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp)
|
|||||||
loader = _cogl_texture_create_loader ();
|
loader = _cogl_texture_create_loader ();
|
||||||
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
||||||
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
|
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),
|
return _cogl_atlas_texture_create_base (_cogl_bitmap_get_context (bmp),
|
||||||
cogl_bitmap_get_width (bmp),
|
cogl_bitmap_get_width (bmp),
|
||||||
|
@ -566,7 +566,6 @@ driver_can_convert (CoglContext *ctx,
|
|||||||
CoglBitmap *
|
CoglBitmap *
|
||||||
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
|
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
|
||||||
CoglPixelFormat internal_format,
|
CoglPixelFormat internal_format,
|
||||||
gboolean can_convert_in_place,
|
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
CoglContext *ctx = _cogl_bitmap_get_context (src_bmp);
|
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,
|
if (_cogl_texture_needs_premult_conversion (src_format,
|
||||||
internal_format))
|
internal_format))
|
||||||
{
|
{
|
||||||
if (can_convert_in_place)
|
dst_bmp = _cogl_bitmap_convert (src_bmp,
|
||||||
{
|
src_format ^ COGL_PREMULT_BIT,
|
||||||
if (_cogl_bitmap_convert_premult_status (src_bmp,
|
error);
|
||||||
(src_format ^
|
if (dst_bmp == NULL)
|
||||||
COGL_PREMULT_BIT),
|
return NULL;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dst_bmp = cogl_object_ref (src_bmp);
|
dst_bmp = cogl_object_ref (src_bmp);
|
||||||
|
@ -105,7 +105,6 @@ _cogl_bitmap_convert (CoglBitmap *bmp,
|
|||||||
CoglBitmap *
|
CoglBitmap *
|
||||||
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
|
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
|
||||||
CoglPixelFormat internal_format,
|
CoglPixelFormat internal_format,
|
||||||
gboolean can_convert_in_place,
|
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -896,7 +896,6 @@ cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
|
|||||||
loader = _cogl_texture_create_loader ();
|
loader = _cogl_texture_create_loader ();
|
||||||
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
||||||
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
|
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),
|
return _cogl_texture_2d_sliced_create_base (_cogl_bitmap_get_context (bmp),
|
||||||
cogl_bitmap_get_width (bmp),
|
cogl_bitmap_get_width (bmp),
|
||||||
@ -987,7 +986,6 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
|
|||||||
CoglBitmap *bmp = loader->src.bitmap.bitmap;
|
CoglBitmap *bmp = loader->src.bitmap.bitmap;
|
||||||
int width = cogl_bitmap_get_width (bmp);
|
int width = cogl_bitmap_get_width (bmp);
|
||||||
int height = cogl_bitmap_get_height (bmp);
|
int height = cogl_bitmap_get_height (bmp);
|
||||||
gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place;
|
|
||||||
CoglPixelFormat internal_format;
|
CoglPixelFormat internal_format;
|
||||||
CoglBitmap *upload_bmp;
|
CoglBitmap *upload_bmp;
|
||||||
|
|
||||||
@ -999,7 +997,6 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
|
|||||||
|
|
||||||
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
||||||
internal_format,
|
internal_format,
|
||||||
can_convert_in_place,
|
|
||||||
error);
|
error);
|
||||||
if (upload_bmp == NULL)
|
if (upload_bmp == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1249,8 +1246,6 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
|
|||||||
|
|
||||||
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
||||||
_cogl_texture_get_format (tex),
|
_cogl_texture_get_format (tex),
|
||||||
FALSE, /* can't convert in
|
|
||||||
place */
|
|
||||||
error);
|
error);
|
||||||
if (!upload_bmp)
|
if (!upload_bmp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -169,7 +169,6 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp)
|
|||||||
loader = _cogl_texture_create_loader ();
|
loader = _cogl_texture_create_loader ();
|
||||||
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
|
||||||
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
|
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),
|
return _cogl_texture_2d_create_base (_cogl_bitmap_get_context (bmp),
|
||||||
cogl_bitmap_get_width (bmp),
|
cogl_bitmap_get_width (bmp),
|
||||||
|
@ -170,7 +170,6 @@ typedef struct _CoglTextureLoader
|
|||||||
CoglBitmap *bitmap;
|
CoglBitmap *bitmap;
|
||||||
int height; /* for 3d textures */
|
int height; /* for 3d textures */
|
||||||
int depth; /* for 3d textures */
|
int depth; /* for 3d textures */
|
||||||
gboolean can_convert_in_place;
|
|
||||||
} bitmap;
|
} bitmap;
|
||||||
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
|
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
|
||||||
struct {
|
struct {
|
||||||
|
@ -197,7 +197,6 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
|
|||||||
CoglPixelFormat internal_format;
|
CoglPixelFormat internal_format;
|
||||||
int width = cogl_bitmap_get_width (bmp);
|
int width = cogl_bitmap_get_width (bmp);
|
||||||
int height = cogl_bitmap_get_height (bmp);
|
int height = cogl_bitmap_get_height (bmp);
|
||||||
gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place;
|
|
||||||
CoglBitmap *upload_bmp;
|
CoglBitmap *upload_bmp;
|
||||||
GLenum gl_intformat;
|
GLenum gl_intformat;
|
||||||
GLenum gl_format;
|
GLenum gl_format;
|
||||||
@ -220,7 +219,6 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
|
|||||||
|
|
||||||
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
|
||||||
internal_format,
|
internal_format,
|
||||||
can_convert_in_place,
|
|
||||||
error);
|
error);
|
||||||
if (upload_bmp == NULL)
|
if (upload_bmp == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -577,7 +575,6 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
|
|||||||
upload_bmp =
|
upload_bmp =
|
||||||
_cogl_bitmap_convert_for_upload (bmp,
|
_cogl_bitmap_convert_for_upload (bmp,
|
||||||
_cogl_texture_get_format (tex),
|
_cogl_texture_get_format (tex),
|
||||||
FALSE, /* can't convert in place */
|
|
||||||
error);
|
error);
|
||||||
if (upload_bmp == NULL)
|
if (upload_bmp == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user