Skip to content

Commit b6f90cf

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Fix Animation bugs from DisplayList properties integration"
2 parents a436860 + 89b7f2e commit b6f90cf

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

core/java/android/view/View.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11489,7 +11489,7 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1148911489
layerType != LAYER_TYPE_HARDWARE;
1149011490

1149111491
int restoreTo = -1;
11492-
if (!useDisplayListProperties) {
11492+
if (!useDisplayListProperties || transformToApply != null) {
1149311493
restoreTo = canvas.save();
1149411494
}
1149511495
if (offsetForScroll) {
@@ -11523,11 +11523,9 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1152311523
if (concatMatrix) {
1152411524
// Undo the scroll translation, apply the transformation matrix,
1152511525
// then redo the scroll translate to get the correct result.
11526-
if (!useDisplayListProperties) {
11527-
canvas.translate(-transX, -transY);
11528-
canvas.concat(transformToApply.getMatrix());
11529-
canvas.translate(transX, transY);
11530-
}
11526+
canvas.translate(-transX, -transY);
11527+
canvas.concat(transformToApply.getMatrix());
11528+
canvas.translate(transX, transY);
1153111529
parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION;
1153211530
}
1153311531

@@ -11556,12 +11554,10 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1155611554
layerFlags |= Canvas.CLIP_TO_LAYER_SAVE_FLAG;
1155711555
}
1155811556
if (layerType == LAYER_TYPE_NONE) {
11559-
if (!useDisplayListProperties) {
11560-
final int scrollX = hasDisplayList ? 0 : sx;
11561-
final int scrollY = hasDisplayList ? 0 : sy;
11562-
canvas.saveLayerAlpha(scrollX, scrollY, scrollX + mRight - mLeft,
11563-
scrollY + mBottom - mTop, multipliedAlpha, layerFlags);
11564-
}
11557+
final int scrollX = hasDisplayList ? 0 : sx;
11558+
final int scrollY = hasDisplayList ? 0 : sy;
11559+
canvas.saveLayerAlpha(scrollX, scrollY, scrollX + mRight - mLeft,
11560+
scrollY + mBottom - mTop, multipliedAlpha, layerFlags);
1156511561
}
1156611562
} else {
1156711563
// Alpha is handled by the child directly, clobber the layer's alpha

0 commit comments

Comments
 (0)