summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-02-20 17:21:30 +0000
committerStefan Schmidt <s.schmidt@samsung.com>2013-02-20 17:21:30 +0000
commit5e99f9b96873a794f40d30bbb997917cf57a5bdf (patch)
treef4a9beae8085c4b4319e73449c82ddb6dacd3fc3
parent251eac7d7a5c6d7f2e4fccac3c2240197b7c5aac (diff)
Revert "Refactor evas_sw_xlib_outbuf to allocate less in case of rotations."
This reverts commit 139737247d563f53a064c7f4a025a89ed64c2983. THis fix was completely wrong. Conflicts: ChangeLog
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_outbuf.c76
3 files changed, 12 insertions, 69 deletions
diff --git a/ChangeLog b/ChangeLog
index 8bbb585492..f693ee63a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,10 +55,6 @@
55 * Fix memory leak in eina_xattr_value_ls. 55 * Fix memory leak in eina_xattr_value_ls.
56 * Fix memory leak in gstreamer_ecore_x_check 56 * Fix memory leak in gstreamer_ecore_x_check
57 57
582013-02-08 Daniel Willman
59
60 * Fix memory usage spike when rotating with the software_x11 engine.
61
622013-02-08 Tom Hacohen (TAsn) 582013-02-08 Tom Hacohen (TAsn)
63 59
64 * Evas textblock: Fixed a selection issue with different scripts and 60 * Evas textblock: Fixed a selection issue with different scripts and
diff --git a/NEWS b/NEWS
index cff0943344..b0d312323f 100644
--- a/NEWS
+++ b/NEWS
@@ -165,7 +165,6 @@ Fixes:
165 * Fix memory usage of Ecore_Con_Server 165 * Fix memory usage of Ecore_Con_Server
166 * Fix memory leak in eina_xattr_value_ls. 166 * Fix memory leak in eina_xattr_value_ls.
167 * Fix memory leak in gstreamer_ecore_x_check 167 * Fix memory leak in gstreamer_ecore_x_check
168 * Fix memory usage spike when rotating with the software_x11 engine.
169 * Evas textblock: Fixed a selection issue with different scripts and bidi. 168 * Evas textblock: Fixed a selection issue with different scripts and bidi.
170 * Fix memory leak in error case in ethumb. 169 * Fix memory leak in error case in ethumb.
171 * fix bug not to display preedit string with PREEDIT_TYPE_NONE style 170 * fix bug not to display preedit string with PREEDIT_TYPE_NONE style
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
index 132bfb0535..d495931e5e 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
@@ -364,7 +364,7 @@ evas_software_xlib_outbuf_setup_x(int w, int h, int rot, Outbuf_Depth depth,
364RGBA_Image * 364RGBA_Image *
365evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch) 365evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch)
366{ 366{
367 RGBA_Image *im = NULL; 367 RGBA_Image *im;
368 Outbuf_Region *obr; 368 Outbuf_Region *obr;
369 int bpl = 0; 369 int bpl = 0;
370 int use_shm = 1; 370 int use_shm = 1;
@@ -459,11 +459,6 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
459 } 459 }
460 else 460 else
461 { 461 {
462 /* FIXME: For the onebuf case we probably need to do the same thing we did below
463 * (try to get an existing image before we allocate a new one). This code path
464 * is not really used at the moment so no way to test (and that's why the change
465 * is not implemented here as well.
466 */
467#ifdef EVAS_CSERVE2 462#ifdef EVAS_CSERVE2
468 if (evas_cserve2_use_get()) 463 if (evas_cserve2_use_get())
469 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get()); 464 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
@@ -617,73 +612,26 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
617 } 612 }
618 else 613 else
619 { 614 {
620 obr->xob = _find_xob(buf->priv.x11.xlib.disp,
621 buf->priv.x11.xlib.vis,
622 buf->priv.x11.xlib.depth,
623 w, h,
624 use_shm,
625 NULL);
626#ifdef EVAS_CSERVE2 615#ifdef EVAS_CSERVE2
627 if (evas_cserve2_use_get()) 616 if (evas_cserve2_use_get())
628 { 617 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
629 if (obr->xob)
630 im = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
631 w, h,
632 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
633 alpha, EVAS_COLORSPACE_ARGB8888);
634
635 if (!im)
636 {
637 if (obr->xob) _unfind_xob(obr->xob, 0);
638 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
639 if (!im)
640 {
641 free(obr);
642 return NULL;
643 }
644 else
645 {
646 im->cache_entry.w = w;
647 im->cache_entry.h = h;
648 im->cache_entry.flags.alpha |= alpha ? 1 : 0;
649 evas_cache2_image_surface_alloc(&im->cache_entry, w, h);
650 }
651 }
652 }
653 else 618 else
654#endif 619#endif
620 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
621 if (!im)
655 { 622 {
656 if (obr->xob) 623 free(obr);
657 im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), 624 return NULL;
658 w, h,
659 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
660 alpha, EVAS_COLORSPACE_ARGB8888);
661
662 if (!im)
663 {
664 if (obr->xob) _unfind_xob(obr->xob, 0);
665 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
666 if (!im)
667 {
668 free(obr);
669 return NULL;
670 }
671 else
672 {
673 im->cache_entry.w = w;
674 im->cache_entry.h = h;
675 im->cache_entry.flags.alpha |= alpha ? 1 : 0;
676 evas_cache_image_surface_alloc(&im->cache_entry, w, h);
677 }
678 }
679 } 625 }
680
681 /* Need to update cache_entry w/h here because the render path expects them to be updated
682 * to the new geometry. */
683 im->cache_entry.w = w; 626 im->cache_entry.w = w;
684 im->cache_entry.h = h; 627 im->cache_entry.h = h;
685 im->cache_entry.flags.alpha |= alpha ? 1 : 0; 628 im->cache_entry.flags.alpha |= alpha ? 1 : 0;
686 629#ifdef EVAS_CSERVE2
630 if (evas_cserve2_use_get())
631 evas_cache2_image_surface_alloc(&im->cache_entry, w, h);
632 else
633#endif
634 evas_cache_image_surface_alloc(&im->cache_entry, w, h);
687 im->extended_info = obr; 635 im->extended_info = obr;
688 if ((buf->rot == 0) || (buf->rot == 180)) 636 if ((buf->rot == 0) || (buf->rot == 180))
689 { 637 {