summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2017-03-16 14:53:49 +0200
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 11:54:09 +0900
commitd98e2323ad93e66b13841d60cbfdd17cdf8fdff2 (patch)
tree14d5b3c30cf2c09a532b3968572ae87eb9d6631a /src/lib/ector
parent6bf5d9d96ef07dcd12f5c9e7ceaa1dbcca046206 (diff)
vg_common: property apply "objectBoundingBox" morphings to radial gradient
When objectBoundingBox flag is set up, all gradients should morphed into multiple gradients for every entity that has gradient to be applied on
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
index e970d23a15..30149e78a8 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
@@ -22,6 +22,11 @@ static void (*cairo_arc)(cairo_t *cr,
22static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL; 22static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL;
23 23
24static void (*cairo_pattern_set_extend)(cairo_pattern_t *pattern, cairo_extend_t extend) = NULL; 24static void (*cairo_pattern_set_extend)(cairo_pattern_t *pattern, cairo_extend_t extend) = NULL;
25static void (*cairo_pattern_set_matrix)(cairo_t *cr, cairo_matrix_t *matrix) = NULL;
26static void (*cairo_matrix_init)(cairo_matrix_t *matrix,
27 double xx, double yx,
28 double xy, double yy,
29 double x0, double y0) = NULL;
25 30
26// FIXME: as long as it is not possible to directly access the parent structure 31// FIXME: as long as it is not possible to directly access the parent structure
27// this will be duplicated from the linear gradient renderer 32// this will be duplicated from the linear gradient renderer
@@ -48,12 +53,14 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_prepare(Eo *obj, Ector_Rend
48} 53}
49 54
50static cairo_pattern_t * 55static cairo_pattern_t *
51_ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED, 56_ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
52 Ector_Renderer_Gradient_Radial_Data *grd, 57 Ector_Renderer_Gradient_Radial_Data *grd,
53 Ector_Renderer_Gradient_Data *gd, 58 Ector_Renderer_Gradient_Data *gd,
54 unsigned int mul_col) 59 unsigned int mul_col)
55{ 60{
61 Ector_Renderer_Data *pd = efl_data_scope_get(obj, ECTOR_RENDERER_CLASS);
56 cairo_pattern_t *pat; 62 cairo_pattern_t *pat;
63 cairo_matrix_t *pd_m;
57 64
58 pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0, 65 pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0,
59 grd->radial.x, grd->radial.y, grd->radius); 66 grd->radial.x, grd->radial.y, grd->radius);
@@ -63,6 +70,16 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED,
63 70
64 cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s)); 71 cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
65 72
73 pd_m = malloc(sizeof (cairo_matrix_t));
74 if (pd->m)
75 {
76 cairo_matrix_init(pd_m,
77 pd->m->xx, pd->m->yx,
78 pd->m->xy, pd->m->yy,
79 pd->m->xz, pd->m->yz);
80 cairo_pattern_set_matrix(pat, pd_m);
81 }
82
66 return pat; 83 return pat;
67} 84}
68 85
@@ -148,9 +165,11 @@ _ector_renderer_cairo_gradient_radial_efl_object_finalize(Eo *obj, Ector_Rendere
148 USE(base, cairo_pattern_destroy, NULL); 165 USE(base, cairo_pattern_destroy, NULL);
149 USE(base, cairo_arc, NULL); 166 USE(base, cairo_arc, NULL);
150 USE(base, cairo_fill, NULL); 167 USE(base, cairo_fill, NULL);
168 USE(base, cairo_matrix_init, NULL);
151 USE(base, cairo_set_source, NULL); 169 USE(base, cairo_set_source, NULL);
152 USE(base, cairo_pattern_destroy, NULL); 170 USE(base, cairo_pattern_destroy, NULL);
153 USE(base, cairo_pattern_set_extend, NULL); 171 USE(base, cairo_pattern_set_extend, NULL);
172 USE(base, cairo_pattern_set_matrix, NULL);
154 USE(base, cairo_pattern_create_radial, NULL); 173 USE(base, cairo_pattern_create_radial, NULL);
155 USE(base, cairo_pattern_add_color_stop_rgba, NULL); 174 USE(base, cairo_pattern_add_color_stop_rgba, NULL);
156 175