summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index ed1edc3bd526..f5b898b72154 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -326,6 +326,8 @@ public final class ViewRootImpl implements ViewParent,
private boolean mForceNextConfigUpdate;
private boolean mUseBLASTAdapter;
+ private boolean mForceDisableBLAST;
+ private boolean mEnableTripleBuffering;
/**
* Signals that compatibility booleans have been initialized according to
@@ -774,7 +776,6 @@ public final class ViewRootImpl implements ViewParent,
loadSystemProperties();
mImeFocusController = new ImeFocusController(this);
- mUseBLASTAdapter = WindowManagerGlobal.useBLAST();
}
public static void addFirstDrawHandler(Runnable callback) {
@@ -915,10 +916,9 @@ public final class ViewRootImpl implements ViewParent,
if (mWindowAttributes.packageName == null) {
mWindowAttributes.packageName = mBasePackageName;
}
- if (mUseBLASTAdapter) {
- mWindowAttributes.privateFlags |=
+ mWindowAttributes.privateFlags |=
WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST;
- }
+
attrs = mWindowAttributes;
setTag();
@@ -1092,6 +1092,13 @@ public final class ViewRootImpl implements ViewParent,
"Unable to add window -- unknown error code " + res);
}
+ if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) {
+ mUseBLASTAdapter = true;
+ }
+ if ((res & WindowManagerGlobal.ADD_FLAG_USE_TRIPLE_BUFFERING) != 0) {
+ mEnableTripleBuffering = true;
+ }
+
if (view instanceof RootViewSurfaceTaker) {
mInputQueueCallback =
((RootViewSurfaceTaker)view).willYouTakeTheInputQueue();
@@ -1404,10 +1411,8 @@ public final class ViewRootImpl implements ViewParent,
}
mWindowAttributes.privateFlags |= compatibleWindowFlag;
- if (mUseBLASTAdapter) {
- mWindowAttributes.privateFlags |=
+ mWindowAttributes.privateFlags |=
WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST;
- }
if (mWindowAttributes.preservePreviousSurfaceInsets) {
// Restore old surface insets.
@@ -1774,7 +1779,7 @@ public final class ViewRootImpl implements ViewParent,
Surface ret = null;
if (mBlastBufferQueue == null) {
mBlastBufferQueue = new BLASTBufferQueue(
- mBlastSurfaceControl, width, height);
+ mBlastSurfaceControl, width, height, mEnableTripleBuffering);
// We only return the Surface the first time, as otherwise
// it hasn't changed and there is no need to update.
ret = mBlastBufferQueue.getSurface();
@@ -7377,7 +7382,7 @@ public final class ViewRootImpl implements ViewParent,
mPendingDisplayCutout, mPendingMergedConfiguration, mSurfaceControl, mTempInsets,
mTempControls, mSurfaceSize, mBlastSurfaceControl);
if (mSurfaceControl.isValid()) {
- if (!mUseBLASTAdapter) {
+ if (!useBLAST()) {
mSurface.copyFrom(mSurfaceControl);
} else {
final Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x,
@@ -9612,7 +9617,7 @@ public final class ViewRootImpl implements ViewParent,
* @hide
*/
public SurfaceControl getRenderSurfaceControl() {
- if (mUseBLASTAdapter) {
+ if (useBLAST()) {
return mBlastSurfaceControl;
} else {
return mSurfaceControl;
@@ -9629,11 +9634,11 @@ public final class ViewRootImpl implements ViewParent,
* flag. Needs to be called before addView.
*/
void forceDisableBLAST() {
- mUseBLASTAdapter = false;
+ mForceDisableBLAST = true;
}
boolean useBLAST() {
- return mUseBLASTAdapter;
+ return mUseBLASTAdapter && !mForceDisableBLAST;
}
/**