2008-11-12 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/cogl/cogl-color.h: * clutter/cogl/cogl-path.h: * clutter/cogl/cogl-types.h: * clutter/cogl/common/cogl-color.c: Deprecated cogl_color() in favour of cogl_set_source_color() and friends; store the CoglColor components as unsigned bytes instead of fixed point normalized values; add functions for allocating, copying and freeing CoglColor, for use of language bindings. * clutter/cogl/cogl.h.in: * clutter/cogl/cogl-deprecated.h: Added cogl-deprecated.h, an header file containing the deprecation symbols similar to clutter-deprecated.h. * clutter/cogl/gl/Makefile.am: * clutter/cogl/gl/cogl-texture.c: * clutter/cogl/gl/cogl.c: * clutter/cogl/gles/Makefile.am: * clutter/cogl/gles/cogl-texture.c: * clutter/cogl/gles/cogl.c: Update the GL and GLES implementations of COGL after the CoglColor changes. * clutter/clutter-actor.c: * clutter/clutter-clone-texture.c: * clutter/clutter-entry.c: * clutter/clutter-label.c: * clutter/clutter-rectangle.c: * clutter/clutter-texture.c: Do not use CoglColor whenever it is possible, and use cogl_set_source_color4ub() instead. * clutter/pango/cogl-pango-render.c: Ditto as above. * doc/reference/clutter/subclassing-ClutterActor.xml: * doc/reference/cogl/cogl-sections.txt: Update the documentation. * tests/interactive/test-cogl-offscreen.c: * tests/interactive/test-cogl-primitives.c: * tests/interactive/test-cogl-tex-convert.c: * tests/interactive/test-cogl-tex-foreign.c: * tests/interactive/test-cogl-tex-getset.c: * tests/interactive/test-cogl-tex-polygon.c: * tests/interactive/test-cogl-tex-tile.c: * tests/interactive/test-paint-wrapper.c: Drop the usage of CoglColor whenever it is possible.
This commit is contained in:
@ -73,7 +73,6 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
ClutterRectangle *rectangle = CLUTTER_RECTANGLE(self);
|
||||
ClutterRectanglePrivate *priv;
|
||||
ClutterGeometry geom;
|
||||
CoglColor tmp_col;
|
||||
guint8 tmp_alpha;
|
||||
|
||||
rectangle = CLUTTER_RECTANGLE(self);
|
||||
@ -94,16 +93,14 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
* account the opacity of the color set by the user
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->border_color.alpha
|
||||
/ 255;
|
||||
* priv->border_color.alpha
|
||||
/ 255;
|
||||
|
||||
/* paint the border */
|
||||
cogl_color_set_from_4ub (&tmp_col,
|
||||
priv->border_color.red,
|
||||
priv->border_color.green,
|
||||
priv->border_color.blue,
|
||||
tmp_alpha);
|
||||
cogl_color (&tmp_col);
|
||||
cogl_set_source_color4ub (priv->border_color.red,
|
||||
priv->border_color.green,
|
||||
priv->border_color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
/* this sucks, but it's the only way to make a border */
|
||||
cogl_rectangle (priv->border_width, 0,
|
||||
@ -124,16 +121,14 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
geom.height - priv->border_width);
|
||||
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
|
||||
/* now paint the rectangle */
|
||||
cogl_color_set_from_4ub (&tmp_col,
|
||||
priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
cogl_color (&tmp_col);
|
||||
cogl_set_source_color4ub (priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
cogl_rectangle (priv->border_width, priv->border_width,
|
||||
geom.width - priv->border_width * 2,
|
||||
@ -145,15 +140,13 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
* account the opacity of the color set by the user
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_color_set_from_4ub (&tmp_col,
|
||||
priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
cogl_color (&tmp_col);
|
||||
cogl_set_source_color4ub (priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
cogl_rectangle (0, 0, geom.width, geom.height);
|
||||
}
|
||||
|
Reference in New Issue
Block a user