Optimizing shadow generation by reusing bitmap.

> Not creating unnecessary bitmaps
> Final bitmap is generated as ALPHA_8 instead of ARGB_8888
> The shadow drawing is done directly in the view

Change-Id: I504fa2ea3abdc1a3c3fb9ad57d6e28880d2584a1
This commit is contained in:
Sunny Goyal
2015-05-14 19:55:10 -07:00
parent a214a63bfe
commit 4fe5a37dda
6 changed files with 188 additions and 154 deletions

View File

@@ -276,7 +276,7 @@ public class BubbleTextView extends TextView {
// Only show the shadow effect when persistent pressed state is set.
if (getParent() instanceof ShortcutAndWidgetContainer) {
CellLayout layout = (CellLayout) getParent().getParent();
layout.setPressedIcon(this, mPressedBackground, mOutlineHelper.shadowBitmapPadding);
layout.setPressedIcon(this, mPressedBackground);
}
updateIconState();