/* Only called when references > 0. Need to provide a fresh copie of im. */ static int _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src) { RGBA_Image *dst = (RGBA_Image *) ie_dst; RGBA_Image *src = (RGBA_Image *) ie_src; evas_common_rgba_image_scalecache_dirty((Image_Entry *)ie_src); evas_common_rgba_image_scalecache_dirty(ie_dst); evas_cache_image_load_data(&src->cache_entry); if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry, src->cache_entry.w, src->cache_entry.h)) { #ifdef EVAS_CSERVE if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); #endif return 1; } #ifdef EVAS_CSERVE if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); #endif evas_common_image_colorspace_normalize(src); evas_common_image_colorspace_normalize(dst); /* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */ /* evas_common_cpu_end_opt(); */ return 0; }
void evas_common_image_colorspace_normalize(RGBA_Image *im) { if ((!im->cs.data) || ((!im->cs.dirty) && (!(im->flags & RGBA_IMAGE_IS_DIRTY)))) return; switch (im->cache_entry.space) { case EVAS_COLORSPACE_ARGB8888: if (im->image.data != im->cs.data) { #ifdef EVAS_CSERVE if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry); #endif if (!im->image.no_free) free(im->image.data); im->image.data = im->cs.data; im->cs.no_free = im->image.no_free; } break; case EVAS_COLORSPACE_YCBCR422P601_PL: #ifdef BUILD_CONVERT_YUV if ((im->image.data) && (*((unsigned char **)im->cs.data))) evas_common_convert_yuv_420p_601_rgba(im->cs.data, (DATA8*) im->image.data, im->cache_entry.w, im->cache_entry.h); #endif break; default: break; } im->cs.dirty = 0; }
static void _evas_common_rgba_image_surface_delete(Image_Entry *ie) { RGBA_Image *im = (RGBA_Image *) ie; if (ie->file) DBG("unload: [%p] %s %s", ie, ie->file, ie->key); if ((im->cs.data) && (im->image.data)) { if (im->cs.data != im->image.data) { if (!im->cs.no_free) free(im->cs.data); } } else if (im->cs.data) { if (!im->cs.no_free) free(im->cs.data); } im->cs.data = NULL; if (im->image.data && !im->image.no_free) free(im->image.data); #ifdef EVAS_CSERVE else if (ie->data1) evas_cserve_image_free(ie); #endif im->image.data = NULL; ie->allocated.w = 0; ie->allocated.h = 0; #ifdef BUILD_ASYNC_PRELOAD ie->flags.preload_done = 0; #endif ie->flags.loaded = 0; evas_common_rgba_image_scalecache_dirty(&im->cache_entry); }
static void _evas_common_rgba_image_delete(Image_Entry *ie) { RGBA_Image *im = (RGBA_Image *) ie; #ifdef BUILD_PIPE_RENDER evas_common_pipe_free(im); # ifdef EVAS_FRAME_QUEUING LKD(im->cache_entry.ref_fq_add); LKD(im->cache_entry.ref_fq_del); pthread_cond_destroy(&(im->cache_entry.cond_fq_del)); # endif #endif evas_common_rgba_image_scalecache_shutdown(&im->cache_entry); if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module); /* memset the image to 0x99 because i recently saw a segv where an * seemed to be used BUT its contents were wrong - it looks like it was * overwritten by something from efreet - as there was an execute command * for a command there and some other signs - but to make sure, I am * going to empty this struct out in case this happens again so i know * that something else is overwritign this struct - or not */ // memset(im, 0x99, sizeof(im)); #ifdef EVAS_CSERVE if (ie->data1) evas_cserve_image_free(ie); #endif free(im); }
static void _evas_common_rgba_image_surface_delete(Image_Entry *ie) { RGBA_Image *im = (RGBA_Image *) ie; if (ie->file) printf("unload: [%p] %s %s\n", ie, ie->file, ie->key); if ((im->cs.data) && (im->image.data)) { if (im->cs.data != im->image.data) { if (!im->cs.no_free) free(im->cs.data); } } else if (im->cs.data) { if (!im->cs.no_free) free(im->cs.data); } im->cs.data = NULL; if (im->image.data && !im->image.no_free) free(im->image.data); #ifdef EVAS_CSERVE else if (ie->data1) evas_cserve_image_free(ie); #endif im->image.data = NULL; evas_common_rgba_image_scalecache_dirty(&im->cache_entry); }
static void _evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__, unsigned int y __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__) { RGBA_Image *im = (RGBA_Image *) ie; #ifdef EVAS_CSERVE if (ie->data1) evas_cserve_image_free(ie); #endif im->flags |= RGBA_IMAGE_IS_DIRTY; evas_common_rgba_image_scalecache_dirty(&im->cache_entry); }