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:
parent
e9f726db84
commit
3305eb10da
@ -32,16 +32,13 @@ class QtSurface extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
@Override
|
@Override
|
||||||
public void surfaceCreated(SurfaceHolder holder)
|
public void surfaceCreated(SurfaceHolder holder)
|
||||||
{
|
{
|
||||||
|
if (m_surfaceCallback != null)
|
||||||
|
m_surfaceCallback.onSurfaceChanged(holder.getSurface());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
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
|
@Override
|
||||||
public void surfaceDestroyed(SurfaceHolder holder)
|
public void surfaceDestroyed(SurfaceHolder holder)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user