Ector_Cairo_Surface_Data *pd,
cairo_t *ctx)
{
- if (pd->internal)
- {
- USE(obj, cairo_destroy, );
+ USE(obj, cairo_destroy, );
- if (pd->cairo) cairo_destroy(pd->cairo);
- pd->internal = EINA_FALSE;
- }
+ if (pd->cairo) cairo_destroy(pd->cairo);
if (!ctx)
{
USE(obj, cairo_image_surface_create, );
{
eo_do_super(obj, ECTOR_CAIRO_SURFACE_CLASS, eo_destructor());
+
+
if (--_cairo_count) return ;
if (_cairo_so) eina_module_free(_cairo_so);
_cairo_so = NULL;
struct _Ector_Cairo_Software_Surface_Data
{
cairo_surface_t *surface;
- cairo_t *ctx;
void *pixels;
void
_ector_cairo_software_surface_surface_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd, void *pixels, unsigned int width, unsigned int height)
{
+ cairo_t *ctx = NULL;
+
USE(obj, cairo_image_surface_create_for_data, );
USE(obj, cairo_surface_destroy, );
USE(obj, cairo_create, );
USE(obj, cairo_destroy, );
if (pd->surface) cairo_surface_destroy(pd->surface); pd->surface = NULL;
- if (pd->ctx) cairo_destroy(pd->ctx); pd->ctx = NULL;
pd->pixels = NULL;
pd->width = 0;
width, height, width * sizeof (int));
if (!pd->surface) goto end;
- pd->ctx = cairo_create(pd->surface);
- if (!pd->ctx) goto end;
+ ctx = cairo_create(pd->surface);
}
pd->pixels = pixels;
evas_common_cpu_end_opt();
eo_do(obj,
- ector_cairo_surface_context_set(pd->ctx),
+ ector_cairo_surface_context_set(ctx),
ector_surface_size_set(pd->width, pd->height));
}