Ector_Surface *surface,
Eina_Matrix3 *ptransform,
Eina_Matrix3 *ctransform,
+ int p_opacity,
+ int c_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method)
{
src_pd = efl_data_scope_get(eina_list_nth(target_pd->comp.src, 0), MY_CLASS);
_evas_vg_render_pre(obj, comp_target,
engine, output, context, surface,
- ctransform, comp, src_pd->comp.method);
+ ctransform, c_opacity, comp, src_pd->comp.method);
}
}
_evas_vg_render_pre(obj, comp_target,
engine, output, context,
surface,
- ptransform, comp, comp_method);
+ ptransform, p_opacity, comp, comp_method);
//4. Generating Composite Image.
ector_buffer_pixels_set(surface, pd->comp.pixels, size.w, size.h, pd->comp.stride,
void *engine, void *output, void *context,
Ector_Surface *surface,
Eina_Matrix3 *ptransform,
+ int p_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method,
void *data)
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
+ EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
//Container may have composite target.
//FIXME : _prepare_comp() should only work in cases with matte or masking.
comp_method = pd->comp.method;
comp = _prepare_comp(vg_pd, pd->comp_target,
engine, output, context, surface,
- ptransform, ctransform, comp, comp_method);
+ ptransform, ctransform, p_opacity, c_a, comp, comp_method);
}
EINA_LIST_FOREACH(pd->children, l, child)
_evas_vg_render_pre(vg_pd, child,
engine, output, context, surface,
- ctransform, comp, comp_method);
+ ctransform, c_a, comp, comp_method);
}
}
void *context EINA_UNUSED,
Ector_Surface *surface,
Eina_Matrix3 *ptransform,
+ int p_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method,
void *data)
gd = efl_data_scope_get(obj, EFL_CANVAS_VG_GRADIENT_CLASS);
EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
+ EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
if (!nd->renderer)
{
ector_renderer_transformation_set(nd->renderer, ctransform);
ector_renderer_origin_set(nd->renderer, nd->x, nd->y);
- ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a);
+ ector_renderer_color_set(nd->renderer, c_r, c_g, c_b, c_a);
ector_renderer_visibility_set(nd->renderer, nd->visibility);
efl_gfx_gradient_stop_set(nd->renderer, gd->colors, gd->colors_count);
efl_gfx_gradient_spread_set(nd->renderer, gd->spread);
void *context EINA_UNUSED,
Ector_Surface *surface,
Eina_Matrix3 *ptransform,
+ int p_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method,
void *data)
gd = efl_data_scope_get(obj, EFL_CANVAS_VG_GRADIENT_CLASS);
EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
+ EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
if (!nd->renderer)
{
ector_renderer_transformation_set(nd->renderer, ctransform);
ector_renderer_origin_set(nd->renderer, nd->x, nd->y);
- ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a);
+ ector_renderer_color_set(nd->renderer, c_r, c_g, c_b, c_a);
ector_renderer_visibility_set(nd->renderer, nd->visibility);
efl_gfx_gradient_stop_set(nd->renderer, gd->colors, gd->colors_count);
efl_gfx_gradient_spread_set(nd->renderer, gd->spread);
void *engine EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED,
Ector_Surface *surface,
Eina_Matrix3 *ptransform,
+ int p_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method,
void *data)
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
+ EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
if (!nd->renderer)
{
}
ector_renderer_image_buffer_set(nd->renderer, pd->buffer);
ector_renderer_transformation_set(nd->renderer, ctransform);
-
-
-
ector_renderer_origin_set(nd->renderer, nd->x, nd->y);
- ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a);
+ ector_renderer_color_set(nd->renderer, c_r, c_g, c_b, c_a);
ector_renderer_visibility_set(nd->renderer, nd->visibility);
-
ector_renderer_comp_method_set(nd->renderer, comp, comp_method);
ector_renderer_prepare(nd->renderer);
}
//ector begin - end for drawing composite images.
//ENFN->ector_begin(engine, buffer, context, ector, 0, 0, EINA_FALSE, EINA_FALSE);
- _evas_vg_render_pre(obj, root, engine, buffer, context, ector, NULL, NULL, 0);
+ _evas_vg_render_pre(obj, root, engine, buffer, context, ector, NULL, 255, NULL, 0);
//ENFN->ector_end(engine, buffer, context, ector, EINA_FALSE);
//Actual content drawing
// FIXME: Move this render_pre to efl_canvas_vg_render()
s = evas_ector_get(obj->layer->evas);
if (pd->root && s)
- _evas_vg_render_pre(obj, pd->root, NULL, NULL, NULL, s, NULL, NULL, 0);
+ _evas_vg_render_pre(obj, pd->root, NULL, NULL, NULL, s, NULL, 255, NULL, 0);
/* now figure what changed and add draw rects */
/* if it just became visible or invisible */
void *engine, void *output, void *context,
Ector_Surface *surface,
Eina_Matrix3 *ptransform,
+ int p_opacity,
Ector_Buffer *comp,
Efl_Gfx_Vg_Composite_Method comp_method,
void *data)
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
+ EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
fill = _evas_vg_render_pre(vg_pd, pd->fill,
engine, output, context,
- surface, ctransform, comp, comp_method);
+ surface, ctransform, c_a, comp, comp_method);
stroke_fill = _evas_vg_render_pre(vg_pd, pd->stroke.fill,
engine, output, context,
- surface, ctransform, comp, comp_method);
+ surface, ctransform, c_a, comp, comp_method);
stroke_marker = _evas_vg_render_pre(vg_pd, pd->stroke.marker,
engine, output, context,
- surface, ctransform, comp, comp_method);
+ surface, ctransform, c_a, comp, comp_method);
if (!nd->renderer)
{
}
ector_renderer_transformation_set(nd->renderer, ctransform);
ector_renderer_origin_set(nd->renderer, nd->x, nd->y);
- ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a);
+ ector_renderer_color_set(nd->renderer, c_r, c_g, c_b, c_a);
ector_renderer_visibility_set(nd->renderer, nd->visibility);
ector_renderer_shape_fill_set(nd->renderer, fill ? fill->renderer : NULL);
ector_renderer_shape_stroke_fill_set(nd->renderer, stroke_fill ? stroke_fill->renderer : NULL);
void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node,
Efl_Canvas_Vg_Node_Data *nd,
void *engine, void *output, void *contenxt, Ector_Surface *surface,
- Eina_Matrix3 *ptransform, Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method, void *data);
+ Eina_Matrix3 *ptransform, int opacity, Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method, void *data);
void *data;
double x, y;
void *engine, void *output, void *context,
Ector_Surface *surface,
Eina_Matrix3 *transform,
+ int opacity,
Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method)
{
if (!child) return NULL;
Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS);
if (nd) nd->render_pre(vg_pd, child, nd,
engine, output, context, surface,
- transform, comp, comp_method, nd->data);
+ transform, opacity, comp, comp_method, nd->data);
return nd;
}
} \
}
+#define EFL_CANVAS_VG_COMPUTE_ALPHA(Current_r, Current_g, Current_b, Current_a, Parent_Opacity, Nd) \
+ int Current_r = Nd->r; \
+ int Current_g = Nd->g; \
+ int Current_b = Nd->b; \
+ int Current_a = Nd->a; \
+ \
+ if (Parent_Opacity < 255) \
+ { \
+ double pa = (double)Parent_Opacity / 255.0; \
+ Current_r = (double)Current_r * pa; \
+ Current_g = (double)Current_g * pa; \
+ Current_b = (double)Current_b * pa; \
+ Current_a = (double)Current_a * pa; \
+ }
#endif