Loading core/java/android/view/ViewRootImpl.java +14 −1 Original line number Diff line number Diff line Loading @@ -3912,7 +3912,8 @@ public final class ViewRootImpl implements ViewParent, return; } final boolean fullRedrawNeeded = mFullRedrawNeeded || mReportNextDraw; final boolean fullRedrawNeeded = mFullRedrawNeeded || mReportNextDraw || mNextDrawUseBLASTSyncTransaction; mFullRedrawNeeded = false; mIsDrawing = true; Loading Loading @@ -9921,6 +9922,18 @@ public final class ViewRootImpl implements ViewParent, } else { t.merge(mRtBLASTSyncTransaction); } // There's potential for the frame callback to get called even if nothing was drawn. // When that occurs, we remove the transaction sent to BBQ since the draw we were // waiting on will not happen. We can apply the transaction here but it will not contain // a buffer since nothing new was drawn. // // This is mainly for the case when the SurfaceView has changed and wants to synchronize // with the main window. If the main window doesn't need to draw anything, we can just // apply the transaction without the new buffer from the main window. if (mBlastBufferQueue != null) { mBlastBufferQueue.setNextTransaction(null); } } } Loading graphics/java/android/graphics/BLASTBufferQueue.java +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.graphics; import android.annotation.Nullable; import android.view.Surface; import android.view.SurfaceControl; Loading Loading @@ -60,8 +61,13 @@ public final class BLASTBufferQueue { return nativeGetSurface(mNativeObject, true /* includeSurfaceControlHandle */); } public void setNextTransaction(SurfaceControl.Transaction t) { nativeSetNextTransaction(mNativeObject, t.mNativeObject); /** * Send the transaction to BBQ so the next frame can be added and not applied immediately. * This gives the caller a chance to apply the transaction when it's ready. * @param t The transaction to add the frame to. This can be null to clear the transaction. */ public void setNextTransaction(@Nullable SurfaceControl.Transaction t) { nativeSetNextTransaction(mNativeObject, t == null ? 0 : t.mNativeObject); } public void update(SurfaceControl sc, int width, int height) { Loading Loading
core/java/android/view/ViewRootImpl.java +14 −1 Original line number Diff line number Diff line Loading @@ -3912,7 +3912,8 @@ public final class ViewRootImpl implements ViewParent, return; } final boolean fullRedrawNeeded = mFullRedrawNeeded || mReportNextDraw; final boolean fullRedrawNeeded = mFullRedrawNeeded || mReportNextDraw || mNextDrawUseBLASTSyncTransaction; mFullRedrawNeeded = false; mIsDrawing = true; Loading Loading @@ -9921,6 +9922,18 @@ public final class ViewRootImpl implements ViewParent, } else { t.merge(mRtBLASTSyncTransaction); } // There's potential for the frame callback to get called even if nothing was drawn. // When that occurs, we remove the transaction sent to BBQ since the draw we were // waiting on will not happen. We can apply the transaction here but it will not contain // a buffer since nothing new was drawn. // // This is mainly for the case when the SurfaceView has changed and wants to synchronize // with the main window. If the main window doesn't need to draw anything, we can just // apply the transaction without the new buffer from the main window. if (mBlastBufferQueue != null) { mBlastBufferQueue.setNextTransaction(null); } } } Loading
graphics/java/android/graphics/BLASTBufferQueue.java +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.graphics; import android.annotation.Nullable; import android.view.Surface; import android.view.SurfaceControl; Loading Loading @@ -60,8 +61,13 @@ public final class BLASTBufferQueue { return nativeGetSurface(mNativeObject, true /* includeSurfaceControlHandle */); } public void setNextTransaction(SurfaceControl.Transaction t) { nativeSetNextTransaction(mNativeObject, t.mNativeObject); /** * Send the transaction to BBQ so the next frame can be added and not applied immediately. * This gives the caller a chance to apply the transaction when it's ready. * @param t The transaction to add the frame to. This can be null to clear the transaction. */ public void setNextTransaction(@Nullable SurfaceControl.Transaction t) { nativeSetNextTransaction(mNativeObject, t == null ? 0 : t.mNativeObject); } public void update(SurfaceControl sc, int width, int height) { Loading