Skip to content

Commit fbba753

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Handle offscreen animations correctly" into jb-mr1-dev
2 parents b75ade9 + 3561d06 commit fbba753

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

core/java/android/view/ViewRootImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
859859
if (dirty == null) {
860860
invalidate();
861861
return null;
862-
} else if (dirty.isEmpty()) {
862+
} else if (dirty.isEmpty() && !mIsAnimating) {
863863
return null;
864864
}
865865

@@ -888,14 +888,14 @@ public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
888888
// Intersect with the bounds of the window to skip
889889
// updates that lie outside of the visible region
890890
final float appScale = mAttachInfo.mApplicationScale;
891-
if (localDirty.intersect(0, 0,
892-
(int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f))) {
893-
if (!mWillDrawSoon) {
894-
scheduleTraversals();
895-
}
896-
} else {
891+
final boolean intersected = localDirty.intersect(0, 0,
892+
(int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f));
893+
if (!intersected) {
897894
localDirty.setEmpty();
898895
}
896+
if (!mWillDrawSoon && (intersected || mIsAnimating)) {
897+
scheduleTraversals();
898+
}
899899

900900
return null;
901901
}

libs/hwui/DisplayListRenderer.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -763,16 +763,17 @@ void DisplayList::outputViewProperties(OpenGLRenderer& renderer, char* indent) {
763763
}
764764
}
765765
if (mAlpha < 1 && !mCaching) {
766-
// TODO: should be able to store the size of a DL at record time and not
767-
// have to pass it into this call. In fact, this information might be in the
768-
// location/size info that we store with the new native transform data.
769-
int flags = SkCanvas::kHasAlphaLayer_SaveFlag;
770-
if (mClipChildren) {
771-
flags |= SkCanvas::kClipToLayer_SaveFlag;
766+
if (!mHasOverlappingRendering) {
767+
ALOGD("%s%s %.2f", indent, "SetAlpha", mAlpha);
768+
} else {
769+
int flags = SkCanvas::kHasAlphaLayer_SaveFlag;
770+
if (mClipChildren) {
771+
flags |= SkCanvas::kClipToLayer_SaveFlag;
772+
}
773+
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", indent, "SaveLayerAlpha",
774+
(float) 0, (float) 0, (float) mRight - mLeft, (float) mBottom - mTop,
775+
mMultipliedAlpha, flags);
772776
}
773-
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", indent, "SaveLayerAlpha",
774-
(float) 0, (float) 0, (float) mRight - mLeft, (float) mBottom - mTop,
775-
mMultipliedAlpha, flags);
776777
}
777778
if (mClipChildren) {
778779
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f", indent, "ClipRect", 0.0f, 0.0f,

0 commit comments

Comments
 (0)