2007-03-19 Matthew Allum <mallum@openedhand.com>

* clutter/clutter-label.c:
        Simple doc fix.
        * clutter/clutter-texture.c: (clutter_texture_get_pixbuf):
        Backport of fix to get_pixbuf on non alpha textures from 0_2 branch.
This commit is contained in:
Matthew Allum 2007-03-19 17:02:48 +00:00
parent 71815c61d9
commit 15970bba9b
3 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2007-03-19 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-label.c:
Simple doc fix.
* clutter/clutter-texture.c: (clutter_texture_get_pixbuf):
Backport of fix to get_pixbuf on non alpha textures from 0_2 branch.
2007-03-19 Emmanuele Bassi <ebassi@openedhand.com> 2007-03-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c: Clean up code; add checks * clutter/clutter-texture.c: Clean up code; add checks

View File

@ -988,7 +988,7 @@ clutter_label_get_attributes (ClutterLabel *label)
* *
* Sets whether the text of the label contains markup in <link * Sets whether the text of the label contains markup in <link
* linkend="PangoMarkupFormat">Pango's text markup * linkend="PangoMarkupFormat">Pango's text markup
* language</link>. See clutter_label_set_markup(). * language</link>.
**/ **/
void void
clutter_label_set_use_markup (ClutterLabel *label, clutter_label_set_use_markup (ClutterLabel *label,

View File

@ -1041,15 +1041,19 @@ clutter_texture_get_pixbuf (ClutterTexture* texture)
ClutterTexturePrivate *priv; ClutterTexturePrivate *priv;
GdkPixbuf *pixbuf = NULL; GdkPixbuf *pixbuf = NULL;
guchar *pixels = NULL; guchar *pixels = NULL;
int bpp = 4;
priv = texture->priv; priv = texture->priv;
if (priv->tiles == NULL) if (priv->tiles == NULL)
return NULL; return NULL;
if (priv->pixel_format == GL_RGB)
bpp = 3;
if (!priv->is_tiled) if (!priv->is_tiled)
{ {
pixels = g_malloc (priv->width * priv->height * 4); pixels = g_malloc (priv->width * priv->height * bpp);
if (pixels == NULL) if (pixels == NULL)
return NULL; return NULL;
@ -1062,7 +1066,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture)
/* read data from gl text and return as pixbuf */ /* read data from gl text and return as pixbuf */
glGetTexImage (priv->target_type, glGetTexImage (priv->target_type,
0, 0,
priv->pixel_format, priv->pixel_format,
priv->pixel_type, priv->pixel_type,
(GLvoid*)pixels); (GLvoid*)pixels);
@ -1072,7 +1076,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture)
8, 8,
priv->width, priv->width,
priv->height, priv->height,
priv->width * 4, priv->width * bpp,
pixbuf_destroy_notify, pixbuf_destroy_notify,
NULL); NULL);
} }
@ -1097,7 +1101,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture)
src_w = priv->x_tiles[x].size; src_w = priv->x_tiles[x].size;
src_h = priv->y_tiles[y].size; src_h = priv->y_tiles[y].size;
pixels = g_malloc (src_w * src_h *4); pixels = g_malloc (src_w * src_h * bpp);
glBindTexture(priv->target_type, priv->tiles[i]); glBindTexture(priv->target_type, priv->tiles[i]);
@ -1117,7 +1121,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture)
8, 8,
src_w, src_w,
src_h, src_h,
src_w * 4, src_w * bpp,
pixbuf_destroy_notify, pixbuf_destroy_notify,
NULL); NULL);