Android: don't call onSurfaceChange() native method with every change

We don't need to re-assign the surface each time it's changed,
instead the assignment needs to be done only when creating or
destroying the surface.

Task-number: QTBUG-132721
Change-Id: I72c8c81a692b9e739af0e0a7b0f934b69a9a0fa8
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
This commit is contained in:
Assam Boudjelthia 2025-01-02 17:36:36 +02:00
parent e9f726db84
commit 3305eb10da

View File

@ -32,16 +32,13 @@ class QtSurface extends SurfaceView implements SurfaceHolder.Callback
@Override
public void surfaceCreated(SurfaceHolder holder)
{
if (m_surfaceCallback != null)
m_surfaceCallback.onSurfaceChanged(holder.getSurface());
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
{
if (width < 1 || height < 1)
return;
if (m_surfaceCallback != null)
m_surfaceCallback.onSurfaceChanged(holder.getSurface());
}
{ }
@Override
public void surfaceDestroyed(SurfaceHolder holder)