Merge "Allow draw hw bitmap on software canvas for hierarchyviewer"

This commit is contained in:
TreeHugger Robot
2017-03-21 21:54:16 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 2 deletions

View File

@@ -17892,7 +17892,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// This case should hopefully never or seldom happen
canvas = new Canvas(bitmap);
}
boolean enabledHwBitmapsInSwMode = canvas.isHwBitmapsInSwModeEnabled();
canvas.setHwBitmapsInSwModeEnabled(true);
if ((backgroundColor & 0xff000000) != 0) {
bitmap.eraseColor(backgroundColor);
}
@@ -17920,6 +17921,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
canvas.restoreToCount(restoreCount);
canvas.setBitmap(null);
canvas.setHwBitmapsInSwModeEnabled(enabledHwBitmapsInSwMode);
if (attachInfo != null) {
// Restore the cached Canvas for our siblings