diff options
author | Romain Guy <romainguy@google.com> | 2013-04-04 22:47:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-04-04 22:47:49 +0000 |
commit | faec826bd6051e41e1299cd14d580a4f50f6fe97 (patch) | |
tree | 33cb4d5294c136b15d1b64fdf462d5d3979d6af3 /core/java/android/view/ViewRootImpl.java | |
parent | de4f8c3872c6284605c168687c69ebfa72ea49d2 (diff) | |
parent | e55945e219dbf4664683a757c5a9d462c98f2e19 (diff) | |
download | frameworks_base-faec826bd6051e41e1299cd14d580a4f50f6fe97.zip frameworks_base-faec826bd6051e41e1299cd14d580a4f50f6fe97.tar.gz frameworks_base-faec826bd6051e41e1299cd14d580a4f50f6fe97.tar.bz2 |
Merge "Reduce the size of dirty invalidates" into jb-mr2-dev
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 9387624..efa8a9e 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -197,7 +197,6 @@ public final class ViewRootImpl implements ViewParent, int mHeight; Rect mDirty; final Rect mCurrentDirty = new Rect(); - final Rect mPreviousDirty = new Rect(); boolean mIsAnimating; CompatibilityInfo.Translator mTranslator; @@ -767,10 +766,11 @@ public final class ViewRootImpl implements ViewParent, final boolean translucent = attrs.format != PixelFormat.OPAQUE; mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent); - mAttachInfo.mHardwareRenderer.setName(attrs.getTitle().toString()); - mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested - = mAttachInfo.mHardwareRenderer != null; - + if (mAttachInfo.mHardwareRenderer != null) { + mAttachInfo.mHardwareRenderer.setName(attrs.getTitle().toString()); + mAttachInfo.mHardwareAccelerated = + mAttachInfo.mHardwareAccelerationRequested = true; + } } else if (fakeHwAccelerated) { // The window had wanted to use hardware acceleration, but this // is not allowed in its process. By setting this flag, it can @@ -2387,14 +2387,10 @@ public final class ViewRootImpl implements ViewParent, mResizeAlpha = resizeAlpha; mCurrentDirty.set(dirty); - mCurrentDirty.union(mPreviousDirty); - mPreviousDirty.set(dirty); dirty.setEmpty(); - if (attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, - animating ? null : mCurrentDirty)) { - mPreviousDirty.set(0, 0, mWidth, mHeight); - } + attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, + animating ? null : mCurrentDirty); } else { // If we get here with a disabled & requested hardware renderer, something went // wrong (an invalidate posted right before we destroyed the hardware surface @@ -2449,6 +2445,8 @@ public final class ViewRootImpl implements ViewParent, canvas = mSurface.lockCanvas(dirty); + // The dirty rectangle can be modified by Surface.lockCanvas() + //noinspection ConstantConditions if (left != dirty.left || top != dirty.top || right != dirty.right || bottom != dirty.bottom) { attachInfo.mIgnoreDirtyState = true; @@ -3099,8 +3097,7 @@ public final class ViewRootImpl implements ViewParent, boolean inTouchMode = msg.arg2 != 0; ensureTouchModeLocally(inTouchMode); - if (mAttachInfo.mHardwareRenderer != null && - mSurface != null && mSurface.isValid()) { + if (mAttachInfo.mHardwareRenderer != null && mSurface.isValid()){ mFullRedrawNeeded = true; try { mAttachInfo.mHardwareRenderer.initializeIfNeeded( |