Alexandre Julliard : wineandroid: Add a helper function to update a window surface.

Alexandre Julliard julliard at winehq.org
Mon Dec 3 15:28:53 CST 2018


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec  3 18:26:50 2018 +0100

wineandroid: Add a helper function to update a window surface.

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

---

 dlls/wineandroid.drv/WineActivity.java | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/wineandroid.drv/WineActivity.java b/dlls/wineandroid.drv/WineActivity.java
index 6e6bbff..9229955 100644
--- a/dlls/wineandroid.drv/WineActivity.java
+++ b/dlls/wineandroid.drv/WineActivity.java
@@ -530,6 +530,20 @@ public class WineActivity extends Activity
             return hwnd;
         }
 
+        private void update_surface( boolean is_client )
+        {
+            if (is_client)
+            {
+                Log.i( LOGTAG, String.format( "set client surface hwnd %08x %s", hwnd, client_surface ));
+                if (client_surface != null) wine_surface_changed( hwnd, client_surface, true );
+            }
+            else
+            {
+                Log.i( LOGTAG, String.format( "set window surface hwnd %08x %s", hwnd, window_surface ));
+                if (window_surface != null) wine_surface_changed( hwnd, window_surface, false );
+            }
+        }
+
         public void set_surface( SurfaceTexture surftex, boolean is_client )
         {
             if (is_client)
@@ -540,8 +554,6 @@ public class WineActivity extends Activity
                     client_surftex = surftex;
                     client_surface = new Surface( surftex );
                 }
-                Log.i( LOGTAG, String.format( "set client surface hwnd %08x %s", hwnd, client_surface ));
-                wine_surface_changed( hwnd, client_surface, true );
             }
             else
             {
@@ -551,9 +563,8 @@ public class WineActivity extends Activity
                     window_surftex = surftex;
                     window_surface = new Surface( surftex );
                 }
-                Log.i( LOGTAG, String.format( "set window surface hwnd %08x %s", hwnd, window_surface ));
-                wine_surface_changed( hwnd, window_surface, false );
             }
+            update_surface( is_client );
         }
 
         public void get_event_pos( MotionEvent event, int[] pos )




More information about the wine-cvs mailing list