cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=48b95c4538643efbc2191e1be8de5ff723984679

commit 48b95c4538643efbc2191e1be8de5ff723984679
Author: Wonsik Jung <sid...@samsung.com>
Date:   Mon Feb 10 14:54:23 2014 +0900

    evas: software_x11 - use evas_xlib_swapper_depth_get to get buffer stride.
    
    Summary: when image cache is created, buffer's size should use stride value.
    
    Test Plan: Create small size window, then try to resizing that.
    
    Reviewers: tasn, seoz, raster, cedric
    
    Reviewed By: cedric
    
    CC: tasn, seoz, raster, cedric
    
    Differential Revision: https://phab.enlightenment.org/D536
    
    Signed-off-by: Cedric BAIL <cedric.b...@samsung.com>
---
 src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c 
b/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c
index a8cfa53..f0a2c78 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c
@@ -227,21 +227,25 @@ evas_software_xlib_swapbuf_new_region_for_update(Outbuf 
*buf, int x, int y, int
         if (!im)
           {
              int ww = 0, hh = 0;
-             
+             int d, bpp;
+
+             d = evas_xlib_swapper_depth_get(buf->priv.swapper);
+             bpp = d / 8;
+
              data = evas_xlib_swapper_buffer_map(buf->priv.swapper, &bpl, 
                                                  &(ww), &(hh));
             // To take stride into account, we do use bpl as the real image 
width, but return the real useful one.
 #ifdef EVAS_CSERVE2
              if (evas_cserve2_use_get())
                im = (RGBA_Image 
*)evas_cache2_image_data(evas_common_image_cache2_get(),
-                                                         bpl / sizeof (int), 
hh, data,
-                                                         
buf->priv.destination_alpha, 
+                                                         bpl/bpp, hh, data,
+                                                         
buf->priv.destination_alpha,
                                                          
EVAS_COLORSPACE_ARGB8888);
              else
 #endif
                im = (RGBA_Image 
*)evas_cache_image_data(evas_common_image_cache_get(),
-                                                        bpl / sizeof (int), 
hh, data,
-                                                        
buf->priv.destination_alpha, 
+                                                        bpl/bpp, hh, data,
+                                                        
buf->priv.destination_alpha,
                                                         
EVAS_COLORSPACE_ARGB8888);
              buf->priv.onebuf = im;
              if (!im) return NULL;

-- 


Reply via email to