From 7d20de28e395941b2d4adc020783b45a284269be Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Thu, 9 Dec 2021 01:18:59 +0800 Subject: [PATCH] Always draw background for task thumbnail Always draw background for task thumbnail because the task snapshot might be translucent or partially empty. For example, when drag-to-dismiss split screen, it will reparent tasks from dismissing split root to the bottom of display. Task thumbnail of those tasks might be partially empty because the snapshot was taken in new bounds inherits from display but with split screen content. Fix: 200096421 Test: drag to dismiss split, observed task thumbnail no longger been cropped. Change-Id: I5d04daa55a558f79ccf5127080088bd0698d06d8 --- .../android/quickstep/views/TaskThumbnailView.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index da92551526..d83387705a 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -307,14 +307,15 @@ public class TaskThumbnailView extends View { } } - // Draw the background in all cases, except when the thumbnail data is opaque + // Always draw the background since the snapshots might be translucent or partially empty + // (For example, tasks been reparented out of dismissing split root when drag-to-dismiss + // split screen). + canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mBackgroundPaint); + final boolean drawBackgroundOnly = mTask == null || mTask.isLocked || mBitmapShader == null || mThumbnailData == null; - if (drawBackgroundOnly || mThumbnailData.isTranslucent) { - canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mBackgroundPaint); - if (drawBackgroundOnly) { - return; - } + if (drawBackgroundOnly) { + return; } canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mPaint);