diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/lib/engines/common/evas_image_main.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_image_main.c | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_image_main.c b/libraries/evas/src/lib/engines/common/evas_image_main.c index d4d847c..d2f8c0b 100644 --- a/libraries/evas/src/lib/engines/common/evas_image_main.c +++ b/libraries/evas/src/lib/engines/common/evas_image_main.c | |||
@@ -145,7 +145,7 @@ _evas_common_rgba_image_new(void) | |||
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | evas_common_rgba_image_scalecache_init(&im->cache_entry); | 147 | evas_common_rgba_image_scalecache_init(&im->cache_entry); |
148 | 148 | ||
149 | return &im->cache_entry; | 149 | return &im->cache_entry; |
150 | } | 150 | } |
151 | 151 | ||
@@ -161,7 +161,7 @@ _evas_common_rgba_image_delete(Image_Entry *ie) | |||
161 | LKD(im->cache_entry.ref_fq_del); | 161 | LKD(im->cache_entry.ref_fq_del); |
162 | eina_condition_free(&(im->cache_entry.cond_fq_del)); | 162 | eina_condition_free(&(im->cache_entry.cond_fq_del)); |
163 | # endif | 163 | # endif |
164 | #endif | 164 | #endif |
165 | evas_common_rgba_image_scalecache_shutdown(&im->cache_entry); | 165 | evas_common_rgba_image_scalecache_shutdown(&im->cache_entry); |
166 | if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module); | 166 | if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module); |
167 | /* memset the image to 0x99 because i recently saw a segv where an | 167 | /* memset the image to 0x99 because i recently saw a segv where an |
@@ -173,13 +173,13 @@ _evas_common_rgba_image_delete(Image_Entry *ie) | |||
173 | // memset(im, 0x99, sizeof(im)); | 173 | // memset(im, 0x99, sizeof(im)); |
174 | #ifdef EVAS_CSERVE | 174 | #ifdef EVAS_CSERVE |
175 | if (ie->data1) evas_cserve_image_free(ie); | 175 | if (ie->data1) evas_cserve_image_free(ie); |
176 | #endif | 176 | #endif |
177 | /* | 177 | /* |
178 | * FIXME: This doesn't seem to be needed... But I'm not sure why. | 178 | * FIXME: This doesn't seem to be needed... But I'm not sure why. |
179 | * -- nash | 179 | * -- nash |
180 | { | 180 | { |
181 | Filtered_Image *fi; | 181 | Filtered_Image *fi; |
182 | 182 | ||
183 | EINA_LIST_FREE(im->filtered, fi) | 183 | EINA_LIST_FREE(im->filtered, fi) |
184 | { | 184 | { |
185 | free(fi->key); | 185 | free(fi->key); |
@@ -249,8 +249,8 @@ evas_common_rgba_image_unload(Image_Entry *ie) | |||
249 | #endif | 249 | #endif |
250 | return; | 250 | return; |
251 | } | 251 | } |
252 | #endif | 252 | #endif |
253 | 253 | ||
254 | if (im->image.data && !im->image.no_free) | 254 | if (im->image.data && !im->image.no_free) |
255 | free(im->image.data); | 255 | free(im->image.data); |
256 | im->image.data = NULL; | 256 | im->image.data = NULL; |
@@ -266,18 +266,19 @@ void | |||
266 | _evas_common_rgba_image_post_surface(Image_Entry *ie) | 266 | _evas_common_rgba_image_post_surface(Image_Entry *ie) |
267 | { | 267 | { |
268 | #ifdef HAVE_PIXMAN | 268 | #ifdef HAVE_PIXMAN |
269 | RGBA_Image *im = (RGBA_Image *) ie; | 269 | # ifdef PIXMAN_IMAGE |
270 | 270 | RGBA_Image *im = (RGBA_Image *)ie; | |
271 | |||
271 | if (im->pixman.im) pixman_image_unref(im->pixman.im); | 272 | if (im->pixman.im) pixman_image_unref(im->pixman.im); |
272 | if (im->cache_entry.flags.alpha) | 273 | if (im->cache_entry.flags.alpha) |
273 | { | 274 | { |
274 | im->pixman.im = pixman_image_create_bits | 275 | im->pixman.im = pixman_image_create_bits |
275 | ( | 276 | ( |
276 | // FIXME: endianess determines this | 277 | // FIXME: endianess determines this |
277 | PIXMAN_a8r8g8b8, | 278 | PIXMAN_a8r8g8b8, |
278 | // PIXMAN_b8g8r8a8, | 279 | // PIXMAN_b8g8r8a8, |
279 | im->cache_entry.w, im->cache_entry.h, | 280 | im->cache_entry.w, im->cache_entry.h, |
280 | im->image.data, | 281 | im->image.data, |
281 | im->cache_entry.w * 4 | 282 | im->cache_entry.w * 4 |
282 | ); | 283 | ); |
283 | } | 284 | } |
@@ -285,16 +286,19 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie) | |||
285 | { | 286 | { |
286 | im->pixman.im = pixman_image_create_bits | 287 | im->pixman.im = pixman_image_create_bits |
287 | ( | 288 | ( |
288 | // FIXME: endianess determines this | 289 | // FIXME: endianess determines this |
289 | PIXMAN_x8r8g8b8, | 290 | PIXMAN_x8r8g8b8, |
290 | // PIXMAN_b8g8r8x8, | 291 | // PIXMAN_b8g8r8x8, |
291 | im->cache_entry.w, im->cache_entry.h, | 292 | im->cache_entry.w, im->cache_entry.h, |
292 | im->image.data, | 293 | im->image.data, |
293 | im->cache_entry.w * 4 | 294 | im->cache_entry.w * 4 |
294 | ); | 295 | ); |
295 | } | 296 | } |
297 | # else | ||
298 | (void)ie; | ||
299 | # endif | ||
296 | #else | 300 | #else |
297 | ie = NULL; | 301 | (void)ie; |
298 | #endif | 302 | #endif |
299 | } | 303 | } |
300 | 304 | ||
@@ -306,7 +310,7 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned | |||
306 | 310 | ||
307 | #ifdef EVAS_CSERVE | 311 | #ifdef EVAS_CSERVE |
308 | if (ie->data1) return 0; | 312 | if (ie->data1) return 0; |
309 | #endif | 313 | #endif |
310 | if (im->image.no_free) return 0; | 314 | if (im->image.no_free) return 0; |
311 | 315 | ||
312 | if (im->flags & RGBA_IMAGE_ALPHA_ONLY) | 316 | if (im->flags & RGBA_IMAGE_ALPHA_ONLY) |
@@ -328,7 +332,7 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned | |||
328 | # endif | 332 | # endif |
329 | #endif | 333 | #endif |
330 | _evas_common_rgba_image_post_surface(ie); | 334 | _evas_common_rgba_image_post_surface(ie); |
331 | 335 | ||
332 | return 0; | 336 | return 0; |
333 | } | 337 | } |
334 | 338 | ||
@@ -338,12 +342,14 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie) | |||
338 | RGBA_Image *im = (RGBA_Image *) ie; | 342 | RGBA_Image *im = (RGBA_Image *) ie; |
339 | 343 | ||
340 | #ifdef HAVE_PIXMAN | 344 | #ifdef HAVE_PIXMAN |
345 | # ifdef PIXMAN_IMAGE | ||
341 | if (im->pixman.im) | 346 | if (im->pixman.im) |
342 | { | 347 | { |
343 | pixman_image_unref(im->pixman.im); | 348 | pixman_image_unref(im->pixman.im); |
344 | im->pixman.im = NULL; | 349 | im->pixman.im = NULL; |
345 | } | 350 | } |
346 | #endif | 351 | # endif |
352 | #endif | ||
347 | if (ie->file) | 353 | if (ie->file) |
348 | DBG("unload: [%p] %s %s", ie, ie->file, ie->key); | 354 | DBG("unload: [%p] %s %s", ie, ie->file, ie->key); |
349 | if ((im->cs.data) && (im->image.data)) | 355 | if ((im->cs.data) && (im->image.data)) |
@@ -364,7 +370,7 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie) | |||
364 | #ifdef EVAS_CSERVE | 370 | #ifdef EVAS_CSERVE |
365 | else if (ie->data1) | 371 | else if (ie->data1) |
366 | evas_cserve_image_free(ie); | 372 | evas_cserve_image_free(ie); |
367 | #endif | 373 | #endif |
368 | 374 | ||
369 | im->image.data = NULL; | 375 | im->image.data = NULL; |
370 | ie->allocated.w = 0; | 376 | ie->allocated.w = 0; |
@@ -391,7 +397,7 @@ _evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__, | |||
391 | 397 | ||
392 | #ifdef EVAS_CSERVE | 398 | #ifdef EVAS_CSERVE |
393 | if (ie->data1) evas_cserve_image_free(ie); | 399 | if (ie->data1) evas_cserve_image_free(ie); |
394 | #endif | 400 | #endif |
395 | im->flags |= RGBA_IMAGE_IS_DIRTY; | 401 | im->flags |= RGBA_IMAGE_IS_DIRTY; |
396 | evas_common_rgba_image_scalecache_dirty(&im->cache_entry); | 402 | evas_common_rgba_image_scalecache_dirty(&im->cache_entry); |
397 | } | 403 | } |
@@ -411,13 +417,13 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src) | |||
411 | { | 417 | { |
412 | #ifdef EVAS_CSERVE | 418 | #ifdef EVAS_CSERVE |
413 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); | 419 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); |
414 | #endif | 420 | #endif |
415 | return 1; | 421 | return 1; |
416 | } | 422 | } |
417 | 423 | ||
418 | #ifdef EVAS_CSERVE | 424 | #ifdef EVAS_CSERVE |
419 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); | 425 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); |
420 | #endif | 426 | #endif |
421 | evas_common_image_colorspace_normalize(src); | 427 | evas_common_image_colorspace_normalize(src); |
422 | evas_common_image_colorspace_normalize(dst); | 428 | evas_common_image_colorspace_normalize(dst); |
423 | /* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */ | 429 | /* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */ |
@@ -431,18 +437,18 @@ _evas_common_rgba_image_ram_usage(Image_Entry *ie) | |||
431 | { | 437 | { |
432 | RGBA_Image *im = (RGBA_Image *)ie; | 438 | RGBA_Image *im = (RGBA_Image *)ie; |
433 | int size = sizeof(struct _RGBA_Image); | 439 | int size = sizeof(struct _RGBA_Image); |
434 | 440 | ||
435 | if (ie->cache_key) size += strlen(ie->cache_key); | 441 | if (ie->cache_key) size += strlen(ie->cache_key); |
436 | if (ie->file) size += strlen(ie->file); | 442 | if (ie->file) size += strlen(ie->file); |
437 | if (ie->key) size += strlen(ie->key); | 443 | if (ie->key) size += strlen(ie->key); |
438 | 444 | ||
439 | if (im->image.data) | 445 | if (im->image.data) |
440 | { | 446 | { |
441 | #ifdef EVAS_CSERVE | 447 | #ifdef EVAS_CSERVE |
442 | if ((!im->image.no_free) || (ie->data1)) | 448 | if ((!im->image.no_free) || (ie->data1)) |
443 | #else | 449 | #else |
444 | if ((!im->image.no_free)) | 450 | if ((!im->image.no_free)) |
445 | #endif | 451 | #endif |
446 | size += im->cache_entry.w * im->cache_entry.h * sizeof(DATA32); | 452 | size += im->cache_entry.w * im->cache_entry.h * sizeof(DATA32); |
447 | } | 453 | } |
448 | size += evas_common_rgba_image_scalecache_usage_get(&im->cache_entry); | 454 | size += evas_common_rgba_image_scalecache_usage_get(&im->cache_entry); |
@@ -590,7 +596,7 @@ evas_common_image_colorspace_normalize(RGBA_Image *im) | |||
590 | { | 596 | { |
591 | #ifdef EVAS_CSERVE | 597 | #ifdef EVAS_CSERVE |
592 | if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry); | 598 | if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry); |
593 | #endif | 599 | #endif |
594 | if (!im->image.no_free) free(im->image.data); | 600 | if (!im->image.no_free) free(im->image.data); |
595 | im->image.data = im->cs.data; | 601 | im->image.data = im->cs.data; |
596 | im->cs.no_free = im->image.no_free; | 602 | im->cs.no_free = im->image.no_free; |