aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:31:33 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:31:33 +0200
commitf41884153f4f9adccdc5af521cc39baf3b41663f (patch)
tree41ba44a217576f4c89b391a5c8b27ae92c4cec95 /src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
parentector: on shutdown our ability to find cairo symbol may no be there anymore. (diff)
downloadefl-f41884153f4f9adccdc5af521cc39baf3b41663f.tar.gz
ector: slightly better implementation for gradient radial draw.
Diffstat (limited to 'src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c')
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c22
1 files changed, 13 insertions, 9 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 c3d0463a6f..69d9155074 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
@@ -15,9 +15,10 @@ static cairo_pattern_t *(*cairo_pattern_create_radial)(double cx0, double cy0,
double radius1) = NULL;
static void (*cairo_set_source)(cairo_t *cr, cairo_pattern_t *source) = NULL;
static void (*cairo_fill)(cairo_t *cr) = NULL;
-static void (*cairo_rectangle)(cairo_t *cr,
- double x, double y,
- double width, double height) = NULL;
+static void (*cairo_arc)(cairo_t *cr,
+ double xc, double yc,
+ double radius,
+ double angle1, double angle2) = NULL;
static void (*cairo_pattern_add_color_stop_rgba)(cairo_pattern_t *pattern, double offset,
double red, double green, double blue, double alpha) = NULL;
static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL;
@@ -71,16 +72,19 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *ob
static Eina_Bool
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, int x, int y, unsigned int mul_col)
{
- Ector_Renderer_Generic_Gradient_Linear_Data *gld;
+ Ector_Renderer_Generic_Gradient_Radial_Data *gld;
// FIXME: don't ignore clipping !
- gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_CLASS);
- if (!pd->pat || !gld || CHECK_CAIRO(pd->parent)) return EINA_FALSE;
+ gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_CLASS);
+ if (!pd->pat || !gld) return EINA_FALSE;
- USE(obj, cairo_rectangle, EINA_FALSE);
+ USE(obj, cairo_arc, EINA_FALSE);
+ USE(obj, cairo_fill, EINA_FALSE);
- cairo_rectangle(pd->parent->cairo, gld->start.x - x, gld->start.y - y,
- gld->end.x - gld->start.x, gld->end.y - gld->start.y);
+ cairo_arc(pd->parent->cairo,
+ gld->radial.x - x, gld->radial.y - y,
+ gld->radius,
+ 0, 2 * M_PI);
eo_do(obj, ector_renderer_cairo_base_fill());
cairo_fill(pd->parent->cairo);