Signed-off-by: André Draszik <andre.dras...@st.com>
---
 systems/sdl/primary.c | 5 ++---
 systems/x11/primary.c | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/systems/sdl/primary.c b/systems/sdl/primary.c
index 7f3dbfc..0978aca 100644
--- a/systems/sdl/primary.c
+++ b/systems/sdl/primary.c
@@ -388,12 +388,11 @@ update_screen( int x, int y, int w, int h )
           return ret;
      }
 
-     src = lock.addr;
      dst = screen->pixels;
-
-     src += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * lock.pitch;
      dst += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * 
screen->pitch;
 
+     src = dfb_surface_data_offset( surface, lock.addr, lock.pitch, x, y);
+
      D_DEBUG_AT( SDL_Updates, "  -> copying pixels...\n" );
 
      switch (screen->format->BitsPerPixel) {
diff --git a/systems/x11/primary.c b/systems/x11/primary.c
index 083ba64..d73aff6 100644
--- a/systems/x11/primary.c
+++ b/systems/x11/primary.c
@@ -868,7 +868,7 @@ update_screen( DFBX11 *x11, const DFBRectangle *clip, 
CoreSurfaceBufferLock *loc
           }
 
           dst = xw->virtualscreen + rect.x * xw->bpp + (rect.y + offset) * 
ximage->bytes_per_line;
-          src = lock->addr + DFB_BYTES_PER_LINE( allocation->config.format, 
rect.x ) + rect.y * lock->pitch;
+          src = dfb_surface_data_offset( allocation->surface, lock->addr, 
lock->pitch, rect.x, rect.y );
 
           switch (xw->depth) {
                case 32:
-- 
1.8.2

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to