From ae8e0aea36f751a6876c9401a031a973822604e0 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 22 Apr 2020 16:24:34 -0700 Subject: BLAST: Avoid JNI call on creation JNI calls aren't free and we don't need to burn one to call update with the values we just passed in. Bug: 152501005 Test: Existing tests pass Change-Id: Iaf272edb03d4ec195b75e9ef7e6c122604025dcb --- core/java/android/view/ViewRootImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 8b1e6cbdb6ff..6f85072a0472 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1793,8 +1793,9 @@ public final class ViewRootImpl implements ViewParent, // We only return the Surface the first time, as otherwise // it hasn't changed and there is no need to update. ret = mBlastBufferQueue.getSurface(); + } else { + mBlastBufferQueue.update(mBlastSurfaceControl, width, height); } - mBlastBufferQueue.update(mBlastSurfaceControl, width, height); return ret; } -- cgit v1.2.3