Use correct texture format for pixmap textures and FBO's

RGBA data in X pixmaps and in FBOs is already premultiplied; use
the right format when creating cogl textures.

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 f90017ab4e
commit 4dcd5f6134
3 changed files with 10 additions and 6 deletions

View File

@ -296,7 +296,7 @@ clutter_texture_realize (ClutterActor *actor)
tex = cogl_texture_new_with_size (priv->width,
priv->height,
flags,
COGL_PIXEL_FORMAT_RGBA_8888);
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
cogl_material_set_layer (priv->material, 0, tex);
@ -2243,7 +2243,7 @@ on_fbo_source_size_change (GObject *object,
tex = cogl_texture_new_with_size (MAX (priv->width, 1),
MAX (priv->height, 1),
flags,
COGL_PIXEL_FORMAT_RGBA_8888);
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
cogl_material_set_layer (priv->material, 0, tex);

View File

@ -359,14 +359,16 @@ create_cogl_texture (ClutterTexture *texture,
handle = cogl_texture_new_from_foreign (tex, CGL_TEXTURE_RECTANGLE_ARB,
width, height,
0, 0,
cogl_format | COGL_BGR_BIT);
cogl_format | COGL_BGR_BIT |
COGL_PREMULT_BIT);
}
else
{
handle
= cogl_texture_new_with_size (width, height,
COGL_TEXTURE_NO_SLICING,
cogl_format | COGL_BGR_BIT);
cogl_format | COGL_BGR_BIT |
COGL_PREMULT_BIT);
using_rectangle = FALSE;
}

View File

@ -871,7 +871,8 @@ clutter_x11_texture_pixmap_update_area_real (ClutterX11TexturePixmap *texture,
width, height,
bytes_per_line,
4,
CLUTTER_TEXTURE_RGB_FLAG_BGR,
CLUTTER_TEXTURE_RGB_FLAG_BGR |
CLUTTER_TEXTURE_RGB_FLAG_PREMULT,
&error);
else
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture),
@ -880,7 +881,8 @@ clutter_x11_texture_pixmap_update_area_real (ClutterX11TexturePixmap *texture,
width, height,
bytes_per_line,
4,
CLUTTER_TEXTURE_RGB_FLAG_BGR,
CLUTTER_TEXTURE_RGB_FLAG_BGR |
CLUTTER_TEXTURE_RGB_FLAG_PREMULT,
&error);