mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
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:
@ -608,14 +608,10 @@ clutter_actor_real_pick (ClutterActor *self,
|
||||
*/
|
||||
if (clutter_actor_should_pick_paint (self))
|
||||
{
|
||||
CoglColor c;
|
||||
|
||||
cogl_color_set_from_4ub (&c,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha);
|
||||
cogl_color (&c);
|
||||
cogl_set_source_color4ub (color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha);
|
||||
cogl_rectangle (0, 0,
|
||||
clutter_actor_get_width (self),
|
||||
clutter_actor_get_height (self));
|
||||
|
@ -142,7 +142,6 @@ clutter_clone_texture_paint (ClutterActor *self)
|
||||
ClutterCloneTexturePrivate *priv;
|
||||
ClutterActor *parent_texture;
|
||||
gint x_1, y_1, x_2, y_2;
|
||||
CoglColor col;
|
||||
CoglHandle cogl_texture;
|
||||
ClutterFixed t_w, t_h;
|
||||
guint tex_width, tex_height;
|
||||
@ -178,9 +177,8 @@ clutter_clone_texture_paint (ClutterActor *self)
|
||||
CLUTTER_TEXTURE_IN_CLONE_PAINT);
|
||||
}
|
||||
|
||||
cogl_color_set_from_4ub (&col, 255, 255, 255,
|
||||
clutter_actor_get_paint_opacity (self));
|
||||
cogl_color (&col);
|
||||
cogl_set_source_color4ub (255, 255, 255,
|
||||
clutter_actor_get_paint_opacity (self));
|
||||
|
||||
clutter_actor_get_allocation_coords (self, &x_1, &y_1, &x_2, &y_2);
|
||||
|
||||
|
@ -411,14 +411,11 @@ clutter_entry_paint_cursor (ClutterEntry *entry)
|
||||
|
||||
if (priv->show_cursor)
|
||||
{
|
||||
CoglColor cursor_color;
|
||||
cogl_set_source_color4ub (priv->fgcol.red,
|
||||
priv->fgcol.green,
|
||||
priv->fgcol.blue,
|
||||
priv->fgcol.alpha);
|
||||
|
||||
cogl_color_set_from_4ub (&cursor_color,
|
||||
priv->fgcol.red,
|
||||
priv->fgcol.green,
|
||||
priv->fgcol.blue,
|
||||
priv->fgcol.alpha);
|
||||
cogl_color (&cursor_color);
|
||||
cogl_rectangle (priv->cursor_pos.x,
|
||||
priv->cursor_pos.y,
|
||||
priv->cursor_pos.width,
|
||||
@ -435,7 +432,7 @@ clutter_entry_paint (ClutterActor *self)
|
||||
gint width, actor_width;
|
||||
gint text_width;
|
||||
gint cursor_x;
|
||||
CoglColor color;
|
||||
CoglColor color = { 0, };
|
||||
|
||||
entry = CLUTTER_ENTRY(self);
|
||||
priv = entry->priv;
|
||||
|
@ -281,8 +281,8 @@ clutter_label_paint (ClutterActor *self)
|
||||
ClutterLabel *label = CLUTTER_LABEL (self);
|
||||
ClutterLabelPrivate *priv = label->priv;
|
||||
PangoLayout *layout;
|
||||
CoglColor color;
|
||||
ClutterActorBox alloc = { 0, };
|
||||
CoglColor color = { 0, };
|
||||
|
||||
if (priv->font_desc == NULL || priv->text == NULL)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -473,7 +473,6 @@ clutter_texture_paint (ClutterActor *self)
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
gint x_1, y_1, x_2, y_2;
|
||||
CoglColor col;
|
||||
CoglColor transparent_col;
|
||||
ClutterFixed t_w, t_h;
|
||||
|
||||
@ -565,12 +564,8 @@ clutter_texture_paint (ClutterActor *self)
|
||||
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
|
||||
: "unknown");
|
||||
|
||||
cogl_color_set_from_4ub (&col,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
clutter_actor_get_paint_opacity (self));
|
||||
cogl_color (&col);
|
||||
cogl_set_source_color4ub (255, 255, 255,
|
||||
clutter_actor_get_paint_opacity (self));
|
||||
|
||||
clutter_actor_get_allocation_coords (self, &x_1, &y_1, &x_2, &y_2);
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CoglColor *cogl_color_new (void);
|
||||
CoglColor *cogl_color_copy (const CoglColor *color);
|
||||
void cogl_color_free (CoglColor *color);
|
||||
|
||||
/**
|
||||
* cogl_color_set_from_4ub:
|
||||
* @dest: return location for a #CoglColor
|
||||
@ -36,7 +40,7 @@ G_BEGIN_DECLS
|
||||
* @blue: value of the blue channel, between 0 and 255
|
||||
* @alpha: value of the alpha channel, between 0 and 255
|
||||
*
|
||||
* Sets the values of the passed channel into a #CoglColor.
|
||||
* Sets the values of the passed channels into a #CoglColor.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
@ -46,14 +50,14 @@ void cogl_color_set_from_4ub (CoglColor *dest,
|
||||
guint8 blue,
|
||||
guint8 alpha);
|
||||
/**
|
||||
* cogl_color_set_from_4ub:
|
||||
* cogl_color_set_from_4d:
|
||||
* @dest: return location for a #CoglColor
|
||||
* @red: value of the red channel, between 0 and 1
|
||||
* @green: value of the green channel, between 0 and 1
|
||||
* @blue: value of the blue channel, between 0 and 1
|
||||
* @alpha: value of the alpha channel, between 0 and 1
|
||||
*
|
||||
* Sets the values of the passed channel into a #CoglColor.
|
||||
* Sets the values of the passed channels into a #CoglColor.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
@ -63,6 +67,24 @@ void cogl_color_set_from_4d (CoglColor *dest,
|
||||
gdouble blue,
|
||||
gdouble alpha);
|
||||
|
||||
/**
|
||||
* cogl_color_set_from_4x:
|
||||
* @dest: return location for a #CoglColor
|
||||
* @red: value of the red channel, between 0 and %COGL_FIXED_1
|
||||
* @green: value of the green channel, between 0 and %COGL_FIXED_1
|
||||
* @blue: value of the blue channel, between 0 and %COGL_FIXED_1
|
||||
* @alpha: value of the alpha channel, between 0 and %COGL_FIXED_1
|
||||
*
|
||||
* Sets the values of the passed channels into a #CoglColor
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void cogl_color_set_from_4x (CoglColor *dest,
|
||||
CoglFixed red,
|
||||
CoglFixed green,
|
||||
CoglFixed blue,
|
||||
CoglFixed alpha);
|
||||
|
||||
/**
|
||||
* cogl_color_get_red_byte:
|
||||
* @color: a #CoglColor
|
||||
@ -219,6 +241,61 @@ CoglFixed cogl_color_get_blue (const CoglColor *color);
|
||||
*/
|
||||
CoglFixed cogl_color_get_alpha (const CoglColor *color);
|
||||
|
||||
/**
|
||||
* cogl_set_source_color:
|
||||
* @color: a #CoglColor
|
||||
*
|
||||
* Sets the source color using normalized values for each component.
|
||||
* This color will be used for any subsequent drawing operation.
|
||||
*
|
||||
* See also cogl_set_source_color4ub() and cogl_set_source_color4x()
|
||||
* if you already have the color components.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void cogl_set_source_color (const CoglColor *color);
|
||||
|
||||
/**
|
||||
* cogl_set_source_color4ub:
|
||||
* @red: value of the red channel, between 0 and 255
|
||||
* @green: value of the green channel, between 0 and 255
|
||||
* @blue: value of the blue channel, between 0 and 255
|
||||
* @alpha: value of the alpha channel, between 0 and 255
|
||||
*
|
||||
* Sets the source color using unsigned bytes for each component. This
|
||||
* color will be used for any subsequent drawing operation.
|
||||
*
|
||||
* The value for each component is an unsigned byte in the range
|
||||
* between 0 and 255.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void cogl_set_source_color4ub (guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha);
|
||||
|
||||
/**
|
||||
* cogl_set_source_color4x:
|
||||
* @red: value of the red channel, between 0 and %COGL_FIXED_1
|
||||
* @green: value of the green channel, between 0 and %COGL_FIXED_1
|
||||
* @blue: value of the blue channel, between 0 and %COGL_FIXED_1
|
||||
* @alpha: value of the alpha channel, between 0 and %COGL_FIXED_1
|
||||
*
|
||||
* Sets the source color using normalized values for each component.
|
||||
* This color will be used for any subsequent drawing operation.
|
||||
*
|
||||
* The value for each component is a fixed point number in the range
|
||||
* between 0 and %COGL_FIXED_1. If the values passed in are outside that
|
||||
* range, they will be clamped.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void cogl_set_source_color4x (CoglFixed red,
|
||||
CoglFixed green,
|
||||
CoglFixed blue,
|
||||
CoglFixed alpha);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_COLOR_H__ */
|
||||
|
5
clutter/cogl/cogl-deprecated.h
Normal file
5
clutter/cogl/cogl-deprecated.h
Normal file
@ -0,0 +1,5 @@
|
||||
#ifndef COGL_DEPRECATED_H
|
||||
|
||||
#define cogl_color cogl_color_REPLACED_BY_cogl_set_source_color
|
||||
|
||||
#endif
|
@ -50,16 +50,6 @@ G_BEGIN_DECLS
|
||||
* rather then in the absolute coordinates.
|
||||
*/
|
||||
|
||||
/**
|
||||
* cogl_color:
|
||||
* @color: new current @CoglColor.
|
||||
*
|
||||
* Changes the color of cogl's current paint, which is used for filling and stroking
|
||||
* primitives.
|
||||
*/
|
||||
void cogl_color (const CoglColor *color);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_rectangle:
|
||||
* @x: X coordinate of the top-left corner
|
||||
|
@ -230,11 +230,11 @@ typedef enum
|
||||
struct _CoglColor
|
||||
{
|
||||
/*< private >*/
|
||||
CoglFixed red;
|
||||
CoglFixed green;
|
||||
CoglFixed blue;
|
||||
guint8 red;
|
||||
guint8 green;
|
||||
guint8 blue;
|
||||
|
||||
CoglFixed alpha;
|
||||
guint8 alpha;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <cogl/cogl-shader.h>
|
||||
#include <cogl/cogl-texture.h>
|
||||
#include <cogl/cogl-types.h>
|
||||
#include <cogl/cogl-deprecated.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -5,6 +5,28 @@
|
||||
#include "cogl-color.h"
|
||||
#include "cogl-fixed.h"
|
||||
|
||||
CoglColor *
|
||||
cogl_color_new (void)
|
||||
{
|
||||
return g_slice_new (CoglColor);
|
||||
}
|
||||
|
||||
CoglColor *
|
||||
cogl_color_copy (const CoglColor *color)
|
||||
{
|
||||
if (G_LIKELY (color))
|
||||
return g_slice_dup (CoglColor, color);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_free (CoglColor *color)
|
||||
{
|
||||
if (G_LIKELY (color))
|
||||
g_slice_free (CoglColor, color);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_from_4ub (CoglColor *dest,
|
||||
guint8 red,
|
||||
@ -14,10 +36,10 @@ cogl_color_set_from_4ub (CoglColor *dest,
|
||||
{
|
||||
g_return_if_fail (dest != NULL);
|
||||
|
||||
dest->red = COGL_FIXED_FROM_FLOAT ((float) red / 0xff * 1.0);
|
||||
dest->green = COGL_FIXED_FROM_FLOAT ((float) green / 0xff * 1.0);
|
||||
dest->blue = COGL_FIXED_FROM_FLOAT ((float) blue / 0xff * 1.0);
|
||||
dest->alpha = COGL_FIXED_FROM_FLOAT ((float) alpha / 0xff * 1.0);
|
||||
dest->red = red;
|
||||
dest->green = green;
|
||||
dest->blue = blue;
|
||||
dest->alpha = alpha;
|
||||
}
|
||||
|
||||
void
|
||||
@ -29,80 +51,119 @@ cogl_color_set_from_4d (CoglColor *dest,
|
||||
{
|
||||
g_return_if_fail (dest != NULL);
|
||||
|
||||
dest->red = COGL_FIXED_FROM_FLOAT (CLAMP (red, 0.0, 1.0));
|
||||
dest->green = COGL_FIXED_FROM_FLOAT (CLAMP (green, 0.0, 1.0));
|
||||
dest->blue = COGL_FIXED_FROM_FLOAT (CLAMP (blue, 0.0, 1.0));
|
||||
dest->alpha = COGL_FIXED_FROM_FLOAT (CLAMP (alpha, 0.0, 1.0));
|
||||
dest->red = 255 * red;
|
||||
dest->green = 255 * green;
|
||||
dest->blue = 255 * blue;
|
||||
dest->alpha = 255 * alpha;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_from_4x (CoglColor *dest,
|
||||
CoglFixed red,
|
||||
CoglFixed green,
|
||||
CoglFixed blue,
|
||||
CoglFixed alpha)
|
||||
{
|
||||
g_return_if_fail (dest != NULL);
|
||||
|
||||
dest->red = COGL_FIXED_TO_INT (red * 255);
|
||||
dest->green = COGL_FIXED_TO_INT (green * 255);
|
||||
dest->blue = COGL_FIXED_TO_INT (blue * 255);
|
||||
dest->alpha = COGL_FIXED_TO_INT (alpha * 255);
|
||||
}
|
||||
|
||||
unsigned char
|
||||
cogl_color_get_red_byte (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_INT (color->red * 255);
|
||||
return color->red;
|
||||
}
|
||||
|
||||
float
|
||||
cogl_color_get_red_float (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_FLOAT (color->red);
|
||||
return (float) color->red / 255.0;
|
||||
}
|
||||
|
||||
CoglFixed
|
||||
cogl_color_get_red (const CoglColor *color)
|
||||
{
|
||||
return color->red;
|
||||
return COGL_FIXED_FROM_FLOAT ((float) color->red / 255.0);
|
||||
}
|
||||
|
||||
unsigned char
|
||||
cogl_color_get_green_byte (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_INT (color->green * 255);
|
||||
return color->green;
|
||||
}
|
||||
|
||||
float
|
||||
cogl_color_get_green_float (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_FLOAT (color->green);
|
||||
return (float) color->green / 255.0;
|
||||
}
|
||||
|
||||
CoglFixed
|
||||
cogl_color_get_green (const CoglColor *color)
|
||||
{
|
||||
return color->green;
|
||||
return COGL_FIXED_FROM_FLOAT ((float) color->green / 255.0);
|
||||
}
|
||||
|
||||
unsigned char
|
||||
cogl_color_get_blue_byte (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_INT (color->blue * 255);
|
||||
return color->blue;
|
||||
}
|
||||
|
||||
float
|
||||
cogl_color_get_blue_float (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_FLOAT (color->blue);
|
||||
return (float) color->blue / 255.0;
|
||||
}
|
||||
|
||||
CoglFixed
|
||||
cogl_color_get_blue (const CoglColor *color)
|
||||
{
|
||||
return color->blue;
|
||||
return COGL_FIXED_FROM_FLOAT ((float) color->blue / 255.0);
|
||||
}
|
||||
|
||||
unsigned char
|
||||
cogl_color_get_alpha_byte (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_INT (color->alpha * 255);
|
||||
return color->alpha;
|
||||
}
|
||||
|
||||
float
|
||||
cogl_color_get_alpha_float (const CoglColor *color)
|
||||
{
|
||||
return COGL_FIXED_TO_FLOAT (color->alpha);
|
||||
return (float) color->alpha / 255.0;
|
||||
}
|
||||
|
||||
CoglFixed
|
||||
cogl_color_get_alpha (const CoglColor *color)
|
||||
{
|
||||
return color->alpha;
|
||||
return COGL_FIXED_FROM_FLOAT ((float) color->alpha / 255.0);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_set_source_color4ub (guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha)
|
||||
{
|
||||
CoglColor c = { 0, };
|
||||
|
||||
cogl_color_set_from_4ub (&c, red, green, blue, alpha);
|
||||
cogl_set_source_color (&c);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_set_source_color4x (CoglFixed red,
|
||||
CoglFixed green,
|
||||
CoglFixed blue,
|
||||
CoglFixed alpha)
|
||||
{
|
||||
CoglColor c = { 0, };
|
||||
|
||||
cogl_color_set_from_4x (&c, red, green, blue, alpha);
|
||||
cogl_set_source_color (&c);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ libclutterinclude_HEADERS = \
|
||||
$(top_builddir)/clutter/cogl/cogl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-defines-gl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-color.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-deprecated.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-fixed.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-offscreen.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-path.h \
|
||||
@ -32,6 +33,7 @@ libclutter_cogl_la_SOURCES = \
|
||||
$(top_builddir)/clutter/cogl/cogl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-defines-gl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-color.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-deprecated.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-fixed.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-offscreen.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-path.h \
|
||||
|
@ -2317,7 +2317,7 @@ cogl_texture_polygon (CoglHandle handle,
|
||||
GLfloat tx, ty;
|
||||
|
||||
if (use_color)
|
||||
cogl_color (&vertices[vnum].color);
|
||||
cogl_set_source_color (&vertices[vnum].color);
|
||||
|
||||
/* Transform the texture co-ordinates so they are
|
||||
relative to the slice */
|
||||
|
@ -380,14 +380,14 @@ cogl_enable_backface_culling (gboolean setting)
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color (const CoglColor *color)
|
||||
cogl_set_source_color (const CoglColor *color)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
glColor4f (cogl_color_get_red_float (color),
|
||||
cogl_color_get_green_float (color),
|
||||
cogl_color_get_blue_float (color),
|
||||
cogl_color_get_alpha_float (color));
|
||||
glColor4ub (cogl_color_get_red_byte (color),
|
||||
cogl_color_get_green_byte (color),
|
||||
cogl_color_get_blue_byte (color),
|
||||
cogl_color_get_alpha_byte (color));
|
||||
|
||||
/* Store alpha for proper blending enables */
|
||||
ctx->color_alpha = cogl_color_get_alpha_byte (color);
|
||||
|
@ -3,6 +3,7 @@ libclutterinclude_HEADERS = \
|
||||
$(top_builddir)/clutter/cogl/cogl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-defines-gles.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-color.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-deprecated.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-fixed.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-offscreen.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-path.h \
|
||||
@ -32,6 +33,7 @@ libclutter_cogl_la_SOURCES = \
|
||||
$(top_builddir)/clutter/cogl/cogl.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-defines-gles.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-color.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-deprecated.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-fixed.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-offscreen.h \
|
||||
$(top_builddir)/clutter/cogl/cogl-path.h \
|
||||
|
@ -505,7 +505,7 @@ _cogl_texture_download_from_gl (CoglTexture *tex,
|
||||
old_dst_factor = ctx->blend_dst_factor;
|
||||
|
||||
/* Direct copy operation */
|
||||
cogl_color (&cwhite);
|
||||
cogl_set_source_color (&cwhite);
|
||||
cogl_blend_func (CGL_ONE, CGL_ZERO);
|
||||
_cogl_texture_draw_and_read (tex, target_bmp,
|
||||
&cwhite, viewport);
|
||||
@ -2302,5 +2302,5 @@ cogl_texture_polygon (CoglHandle handle,
|
||||
/* Set the last color so that the cache of the alpha value will work
|
||||
properly */
|
||||
if (use_color && n_vertices > 0)
|
||||
cogl_color (&vertices[n_vertices - 1].color);
|
||||
cogl_set_source_color (&vertices[n_vertices - 1].color);
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ cogl_enable_backface_culling (gboolean setting)
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color (const CoglColor *color)
|
||||
cogl_set_source_color (const CoglColor *color)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
@ -347,24 +347,20 @@ cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout)
|
||||
|
||||
static void
|
||||
cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer,
|
||||
PangoRenderPart part)
|
||||
PangoRenderPart part)
|
||||
{
|
||||
PangoColor *pango_color = pango_renderer_get_color (renderer, part);
|
||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||
CoglColor color;
|
||||
|
||||
if (pango_color)
|
||||
{
|
||||
cogl_color_set_from_4ub (&color,
|
||||
pango_color->red >> 8,
|
||||
pango_color->green >> 8,
|
||||
pango_color->blue >> 8,
|
||||
cogl_color_get_alpha_byte (&priv->color));
|
||||
cogl_set_source_color4ub (pango_color->red >> 8,
|
||||
pango_color->green >> 8,
|
||||
pango_color->blue >> 8,
|
||||
cogl_color_get_alpha_byte (&priv->color));
|
||||
}
|
||||
else
|
||||
color = priv->color;
|
||||
|
||||
cogl_color (&color);
|
||||
cogl_set_source_color (&priv->color);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user