evas: use the correct method to multiply color.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:33:03 +0000 (16:33 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:33:03 +0000 (16:33 +0200)
src/modules/evas/engines/software_generic/evas_engine.c

index f5a7d1b..6323ba4 100644 (file)
@@ -3530,7 +3530,7 @@ eng_ector_renderer_draw(void *data EINA_UNUSED, void *context, void *surface, Ec
    Eina_Rectangle *r;
    Eina_Rectangle clip;
    Eina_Array_Iterator it;
-   unsigned int i, col;
+   unsigned int i;
 
    if (dc->clip.use)
      {
@@ -3571,21 +3571,11 @@ eng_ector_renderer_draw(void *data EINA_UNUSED, void *context, void *surface, Ec
    if (eina_array_count(c) == 0)
      eina_array_push(c, eina_rectangle_new(clip.x, clip.y, clip.w, clip.h));
 
-   {
-      unsigned int mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
-      int r, g, b, a;
-
-      r = (R_VAL(&mul_col) * R_VAL(&dc->col.col)) >> 8;
-      g = (G_VAL(&mul_col) * G_VAL(&dc->col.col)) >> 8;
-      b = (B_VAL(&mul_col) * B_VAL(&dc->col.col)) >> 8;
-      a = (A_VAL(&mul_col) * A_VAL(&dc->col.col)) >> 8;
-      col = ARGB_JOIN(r, g, b, a);
-   }
-
    ector.r = eo_ref(renderer);
    ector.clips = c;
    ector.render_op = _evas_render_op_to_ector_rop(dc->render_op);
-   ector.mul_col = col;
+   ector.mul_col = ector_color_multiply(dc->mul.use ? dc->mul.col : 0xffffffff,
+                                        dc->col.col);;
    ector.x = x;
    ector.y = y;
    ector.free_it = EINA_FALSE;