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

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-12-03 18:26:50 +01:00
parent 357c2bb9f9
commit cc06703e3a
1 changed files with 15 additions and 4 deletions

View File

@ -530,6 +530,20 @@ public int get_hwnd()
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 @@ else if (surftex != client_surftex)
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 @@ else if (surftex != window_surftex)
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 )