ector: fix transform issue in cairo backend.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Subhransu Mohanty 2015-04-03 16:34:19 +02:00 committed by Cedric BAIL
parent 72967efd9d
commit 6c64f2db74
2 changed files with 5 additions and 11 deletions

View File

@ -73,7 +73,6 @@ _ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
typedef struct _cairo_surface_t cairo_surface_t;
static void (*cairo_translate)(cairo_t *cr, double tx, double ty) = NULL;
static void (*cairo_destroy)(cairo_t *cr) = NULL;
static cairo_surface_t *(*cairo_image_surface_create)(int format,
int width,
@ -118,11 +117,8 @@ _ector_cairo_surface_ector_generic_surface_reference_point_set(Eo *obj EINA_UNUS
Ector_Cairo_Surface_Data *pd,
int x, int y)
{
if (pd->cairo)
{
USE(obj, cairo_translate, );
cairo_translate(pd->cairo, x, y);
}
pd->current.x = x;
pd->current.y = y;
}
static void

View File

@ -170,15 +170,13 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
cairo_set_operator(pd->parent->cairo, cop);
cairo_transform(pd->parent->cairo, &identity);
cx = pd->generic->origin.x - pd->parent->current.x;
cy = pd->generic->origin.y - pd->parent->current.y;
cx = pd->generic->origin.x + pd->parent->current.x;
cy = pd->generic->origin.y + pd->parent->current.y;
cairo_translate(pd->parent->cairo, cx, cy);
if (pd->m) cairo_transform(pd->parent->cairo, pd->m);
pd->parent->current.x = pd->generic->origin.x;
pd->parent->current.y = pd->generic->origin.y;
cairo_set_source_rgba(pd->parent->cairo, r/255.0, g/255.0, b/255.0, a/255.0);
USE(obj, cairo_new_path, EINA_FALSE);