summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-23 12:54:51 -0700
committerChet Haase <chet@google.com>2012-10-23 15:30:15 -0700
commit3561d062ff01f3455c984e4cfcd101a64a2e902f (patch)
tree200f8761630bcb930a6b5fa4ddf410e54a958932 /core/java/android/view
parent74437532fe2a3e9ebd15c61327fd3f2b68c299b3 (diff)
downloadframeworks_base-3561d062ff01f3455c984e4cfcd101a64a2e902f.zip
frameworks_base-3561d062ff01f3455c984e4cfcd101a64a2e902f.tar.gz
frameworks_base-3561d062ff01f3455c984e4cfcd101a64a2e902f.tar.bz2
Handle offscreen animations correctly
A bug in software rendering caused animations on views that are offscreen to not get drawn, therefore the animation doesn't continue (since old-style animations depend on the logic in the drawing code to keep running). Fix is to special case the isAnimating case in ViewRoot to go ahead and schedule a traversal even if the dirty rect does not intersect with the visible region. Issue #7396035 Animations starting offscreen don't draw run/end/draw properly (sw rendering only) Change-Id: Iae25b3a424ddc5a16ba431ecd68cf42d5500db3f
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/ViewRootImpl.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 8a82a54..b96a1c2 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -861,7 +861,7 @@ public final class ViewRootImpl implements ViewParent,
if (dirty == null) {
invalidate();
return null;
- } else if (dirty.isEmpty()) {
+ } else if (dirty.isEmpty() && !mIsAnimating) {
return null;
}
@@ -890,14 +890,14 @@ public final class ViewRootImpl implements ViewParent,
// Intersect with the bounds of the window to skip
// updates that lie outside of the visible region
final float appScale = mAttachInfo.mApplicationScale;
- if (localDirty.intersect(0, 0,
- (int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f))) {
- if (!mWillDrawSoon) {
- scheduleTraversals();
- }
- } else {
+ final boolean intersected = localDirty.intersect(0, 0,
+ (int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f));
+ if (!intersected) {
localDirty.setEmpty();
}
+ if (!mWillDrawSoon && (intersected || mIsAnimating)) {
+ scheduleTraversals();
+ }
return null;
}