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:
parent
f90017ab4e
commit
4dcd5f6134
@ -296,7 +296,7 @@ clutter_texture_realize (ClutterActor *actor)
|
|||||||
tex = cogl_texture_new_with_size (priv->width,
|
tex = cogl_texture_new_with_size (priv->width,
|
||||||
priv->height,
|
priv->height,
|
||||||
flags,
|
flags,
|
||||||
COGL_PIXEL_FORMAT_RGBA_8888);
|
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
|
||||||
|
|
||||||
cogl_material_set_layer (priv->material, 0, tex);
|
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),
|
tex = cogl_texture_new_with_size (MAX (priv->width, 1),
|
||||||
MAX (priv->height, 1),
|
MAX (priv->height, 1),
|
||||||
flags,
|
flags,
|
||||||
COGL_PIXEL_FORMAT_RGBA_8888);
|
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
|
||||||
|
|
||||||
cogl_material_set_layer (priv->material, 0, tex);
|
cogl_material_set_layer (priv->material, 0, tex);
|
||||||
|
|
||||||
|
@ -359,14 +359,16 @@ create_cogl_texture (ClutterTexture *texture,
|
|||||||
handle = cogl_texture_new_from_foreign (tex, CGL_TEXTURE_RECTANGLE_ARB,
|
handle = cogl_texture_new_from_foreign (tex, CGL_TEXTURE_RECTANGLE_ARB,
|
||||||
width, height,
|
width, height,
|
||||||
0, 0,
|
0, 0,
|
||||||
cogl_format | COGL_BGR_BIT);
|
cogl_format | COGL_BGR_BIT |
|
||||||
|
COGL_PREMULT_BIT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handle
|
handle
|
||||||
= cogl_texture_new_with_size (width, height,
|
= cogl_texture_new_with_size (width, height,
|
||||||
COGL_TEXTURE_NO_SLICING,
|
COGL_TEXTURE_NO_SLICING,
|
||||||
cogl_format | COGL_BGR_BIT);
|
cogl_format | COGL_BGR_BIT |
|
||||||
|
COGL_PREMULT_BIT);
|
||||||
|
|
||||||
using_rectangle = FALSE;
|
using_rectangle = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -871,7 +871,8 @@ clutter_x11_texture_pixmap_update_area_real (ClutterX11TexturePixmap *texture,
|
|||||||
width, height,
|
width, height,
|
||||||
bytes_per_line,
|
bytes_per_line,
|
||||||
4,
|
4,
|
||||||
CLUTTER_TEXTURE_RGB_FLAG_BGR,
|
CLUTTER_TEXTURE_RGB_FLAG_BGR |
|
||||||
|
CLUTTER_TEXTURE_RGB_FLAG_PREMULT,
|
||||||
&error);
|
&error);
|
||||||
else
|
else
|
||||||
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture),
|
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture),
|
||||||
@ -880,7 +881,8 @@ clutter_x11_texture_pixmap_update_area_real (ClutterX11TexturePixmap *texture,
|
|||||||
width, height,
|
width, height,
|
||||||
bytes_per_line,
|
bytes_per_line,
|
||||||
4,
|
4,
|
||||||
CLUTTER_TEXTURE_RGB_FLAG_BGR,
|
CLUTTER_TEXTURE_RGB_FLAG_BGR |
|
||||||
|
CLUTTER_TEXTURE_RGB_FLAG_PREMULT,
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user