Alexandre Julliard : wineandroid: Don' t allocate a window surface for off-screen windows.

Alexandre Julliard julliard at winehq.org
Mon Jan 22 15:34:55 CST 2018


Module: wine
Branch: master
Commit: a6f85e616d127b4d0b9ca7ae5e5631177f355ed5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a6f85e616d127b4d0b9ca7ae5e5631177f355ed5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan 22 12:45:46 2018 +0100

wineandroid: Don't allocate a window surface for off-screen windows.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wineandroid.drv/window.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 568f5ab..22e2181 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -1028,17 +1028,15 @@ static struct android_win_data *create_win_data( HWND hwnd, const RECT *window_r
 }
 
 
-static inline RECT get_surface_rect( const RECT *visible_rect )
+static inline BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect )
 {
-    RECT rect;
-
-    IntersectRect( &rect, visible_rect, &virtual_screen_rect );
-    OffsetRect( &rect, -visible_rect->left, -visible_rect->top );
-    rect.left &= ~31;
-    rect.top  &= ~31;
-    rect.right  = max( rect.left + 32, (rect.right + 31) & ~31 );
-    rect.bottom = max( rect.top + 32, (rect.bottom + 31) & ~31 );
-    return rect;
+    if (!IntersectRect( surface_rect, visible_rect, &virtual_screen_rect )) return FALSE;
+    OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top );
+    surface_rect->left &= ~31;
+    surface_rect->top  &= ~31;
+    surface_rect->right  = max( surface_rect->left + 32, (surface_rect->right + 31) & ~31 );
+    surface_rect->bottom = max( surface_rect->top + 32, (surface_rect->bottom + 31) & ~31 );
+    return TRUE;
 }
 
 
@@ -1069,8 +1067,8 @@ void CDECL ANDROID_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_fla
     if (data->parent) goto done;
     if (swp_flags & SWP_HIDEWINDOW) goto done;
     if (is_argb_surface( data->surface )) goto done;
+    if (!get_surface_rect( visible_rect, &surface_rect )) goto done;
 
-    surface_rect = get_surface_rect( visible_rect );
     if (data->surface)
     {
         if (!memcmp( &data->surface->rect, &surface_rect, sizeof(surface_rect) ))




More information about the wine-cvs mailing list