Merge "SurfaceView: Ensure we don't fill unused BLAST Transaction." into rvc-dev am: 0e22967d6c
Change-Id: If6751de5458c89abb2fa29e00ceac4c91c6afda0
This commit is contained in:
@@ -1241,7 +1241,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
private void applySurfaceTransforms(SurfaceControl surface, SurfaceControl.Transaction t,
|
private void applySurfaceTransforms(SurfaceControl surface, SurfaceControl.Transaction t,
|
||||||
Rect position, long frameNumber) {
|
Rect position, long frameNumber) {
|
||||||
final ViewRootImpl viewRoot = getViewRootImpl();
|
final ViewRootImpl viewRoot = getViewRootImpl();
|
||||||
if (frameNumber > 0 && viewRoot != null && !viewRoot.useBLAST()) {
|
if (frameNumber > 0 && viewRoot != null && !viewRoot.isDrawingToBLASTTransaction()) {
|
||||||
t.deferTransactionUntil(surface, viewRoot.getRenderSurfaceControl(),
|
t.deferTransactionUntil(surface, viewRoot.getRenderSurfaceControl(),
|
||||||
frameNumber);
|
frameNumber);
|
||||||
}
|
}
|
||||||
@@ -1258,7 +1258,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
|
|
||||||
private void setParentSpaceRectangle(Rect position, long frameNumber) {
|
private void setParentSpaceRectangle(Rect position, long frameNumber) {
|
||||||
final ViewRootImpl viewRoot = getViewRootImpl();
|
final ViewRootImpl viewRoot = getViewRootImpl();
|
||||||
final boolean useBLAST = viewRoot.useBLAST();
|
final boolean useBLAST = viewRoot.isDrawingToBLASTTransaction();
|
||||||
final SurfaceControl.Transaction t = useBLAST ? viewRoot.getBLASTSyncTransaction() :
|
final SurfaceControl.Transaction t = useBLAST ? viewRoot.getBLASTSyncTransaction() :
|
||||||
mRtTransaction;
|
mRtTransaction;
|
||||||
|
|
||||||
@@ -1319,7 +1319,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
@Override
|
@Override
|
||||||
public void positionLost(long frameNumber) {
|
public void positionLost(long frameNumber) {
|
||||||
final ViewRootImpl viewRoot = getViewRootImpl();
|
final ViewRootImpl viewRoot = getViewRootImpl();
|
||||||
boolean useBLAST = viewRoot != null && viewRoot.useBLAST();
|
boolean useBLAST = viewRoot != null && viewRoot.isDrawingToBLASTTransaction();
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, String.format("%d windowPositionLost, frameNr = %d",
|
Log.d(TAG, String.format("%d windowPositionLost, frameNr = %d",
|
||||||
System.identityHashCode(this), frameNumber));
|
System.identityHashCode(this), frameNumber));
|
||||||
|
|||||||
@@ -9610,4 +9610,12 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
boolean useBLAST() {
|
boolean useBLAST() {
|
||||||
return mUseBLASTAdapter;
|
return mUseBLASTAdapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if we are about to or currently processing a draw directed
|
||||||
|
* in to a BLAST transaction.
|
||||||
|
*/
|
||||||
|
boolean isDrawingToBLASTTransaction() {
|
||||||
|
return mNextReportConsumeBLAST;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user