Avoid unnecesary unpremultiplication when saving to local data

Now that we typically have premultiplied data stored in Cogl
textures, when fetching a texture into local data for temporary
storage, use a premultiplied format to avoid an unpremultiply/
premultiply roundtrip.

http://bugzilla.openedhand.com/show_bug.cgi?id=1406

Signed-off-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Owen W. Taylor 2009-05-09 14:39:01 -04:00 committed by Robert Bragg
parent 1e5b5d10c5
commit 5e18cee77a

View File

@ -1225,7 +1225,7 @@ clutter_texture_save_to_local_data (ClutterTexture *texture)
if (cogl_texture_get_data (cogl_texture, if (cogl_texture_get_data (cogl_texture,
priv->local_data_has_alpha priv->local_data_has_alpha
? COGL_PIXEL_FORMAT_RGBA_8888 ? COGL_PIXEL_FORMAT_RGBA_8888_PRE
: COGL_PIXEL_FORMAT_RGB_888, : COGL_PIXEL_FORMAT_RGB_888,
priv->local_data_rowstride, priv->local_data_rowstride,
priv->local_data) == 0) priv->local_data) == 0)
@ -1252,7 +1252,7 @@ clutter_texture_load_from_local_data (ClutterTexture *texture)
priv->local_data_height, priv->local_data_height,
priv->local_data_rowstride, priv->local_data_rowstride,
priv->local_data_has_alpha ? 4: 3, priv->local_data_has_alpha ? 4: 3,
0, NULL); CLUTTER_TEXTURE_RGB_FLAG_PREMULT, NULL);
g_free (priv->local_data); g_free (priv->local_data);
priv->local_data = NULL; priv->local_data = NULL;