return NULL;
}
- ddob->im.pixels = (DATA16 *)surface_desc.lpSurface;
- ddob->im.w = width;
- ddob->im.h = height;
- ddob->im.stride = width;
- ddob->im.references = 1;
+ ddob->data = (DATA16 *)surface_desc.lpSurface;
if (FAILED(ddob->dd.surface_source->Unlock(NULL)))
{
free(ddob);
return NULL;
}
+ if (ddob->im)
+ evas_cache_image_drop(&ddob->im->cache_entry);
+
+ ddob->im = (Soft16_Image *) evas_cache_image_data(evas_common_soft16_image_cache_get(), width, height, (DATA32 *) ddob->data, 0, EVAS_COLORSPACE_RGB565_A5P);
+ if (ddob->im)
+ ddob->im->stride = ddob->pitch;
return ddob;
}
}
static void
-_tmp_out_free(Soft16_Image *tmp_out)
-{
- free(tmp_out->pixels);
- free(tmp_out);
-}
-
-static void
_tmp_out_alloc(Render_Engine *re)
{
Tilebuf_Rect *r;
if (re->tmp_out)
{
- if ((re->tmp_out->w < w) || (re->tmp_out->h < h))
+ if ((re->tmp_out->cache_entry.w < w) || (re->tmp_out->cache_entry.h < h))
{
- _tmp_out_free(re->tmp_out);
+ evas_cache_image_drop(&re->tmp_out->cache_entry);
re->tmp_out = NULL;
}
}
{
Soft16_Image *im;
- im = calloc(1, sizeof(Soft16_Image));
- im->w = w;
- im->h = h;
- im->stride = w + ((w % 4) ? (4 - (w % 4)) : 0);
- im->have_alpha = 0;
- im->references = 1;
- im->free_pixels = 1;
- im->pixels = malloc(h * im->stride * sizeof(DATA16));
+ im = (Soft16_Image *) evas_cache_image_empty(evas_common_soft16_image_cache_get());
+ im->cache_entry.flags.alpha = 0;
+ evas_cache_image_surface_alloc(&im->cache_entry, w, h);
re->tmp_out = im;
}
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
if (re->tmp_out)
{
- _tmp_out_free(re->tmp_out);
+ evas_cache_image_drop(&re->tmp_out->cache_entry);
re->tmp_out = NULL;
}
}
if (re->clip_rects) DeleteObject(re->clip_rects);
if (re->tb) evas_common_tilebuf_free(re->tb);
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
- if (re->tmp_out) _tmp_out_free(re->tmp_out);
+ if (re->tmp_out) evas_cache_image_drop(&re->tmp_out->cache_entry);
free(re);
evas_common_font_shutdown();
}
if (re->tmp_out)
{
- _tmp_out_free(re->tmp_out);
+ evas_cache_image_drop(&re->tmp_out->cache_entry);
re->tmp_out = NULL;
}
}
d = &re->ddob->im;
s = re->tmp_out;
- if ((w < 1) || (h < 1) || (out_x >= d->w) || (out_y >= d->h))
+ if ((w < 1) || (h < 1) || (out_x >= d->cache_entry.w) || (out_y >= d->cache_entry.h))
return;
if (re->rotation == 90)
}
if (re->tmp_out)
{
- _tmp_out_free(re->tmp_out);
+ evas_cache_image_drop(&re->tmp_out->cache_entry);
re->tmp_out = NULL;
}
}