summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/graphics
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-10-11 22:09:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-10-11 22:09:48 +0000
commitf8fa9e4124bccea8faa73726598cdf1f2dd78720 (patch)
treeb33819bafcd2fca1e782da4f62a3b10972662802 /src/com/android/launcher3/graphics
parent9c76a9cecedd1e33708aa6d19980cfc73ae2caf8 (diff)
parent5d9fb0e92f2ef2b25f3aa93c1f89838ccc68aa88 (diff)
downloadandroid_packages_apps_Trebuchet-f8fa9e4124bccea8faa73726598cdf1f2dd78720.tar.gz
android_packages_apps_Trebuchet-f8fa9e4124bccea8faa73726598cdf1f2dd78720.tar.bz2
android_packages_apps_Trebuchet-f8fa9e4124bccea8faa73726598cdf1f2dd78720.zip
Merge "Simplifying fast scroller logic" into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r--src/com/android/launcher3/graphics/HolographicOutlineHelper.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/com/android/launcher3/graphics/HolographicOutlineHelper.java b/src/com/android/launcher3/graphics/HolographicOutlineHelper.java
index 0d70bdee1..9c397210e 100644
--- a/src/com/android/launcher3/graphics/HolographicOutlineHelper.java
+++ b/src/com/android/launcher3/graphics/HolographicOutlineHelper.java
@@ -158,18 +158,13 @@ public class HolographicOutlineHelper {
}
public Bitmap createMediumDropShadow(BubbleTextView view) {
- return createMediumDropShadow(view.getIcon(), view.getScaleX(), view.getScaleY(), true);
- }
-
- public Bitmap createMediumDropShadow(Drawable drawable, boolean shouldCache) {
- return createMediumDropShadow(drawable, 1f, 1f, shouldCache);
- }
-
- Bitmap createMediumDropShadow(Drawable drawable, float scaleX, float scaleY,
- boolean shouldCache) {
+ Drawable drawable = view.getIcon();
if (drawable == null) {
return null;
}
+
+ float scaleX = view.getScaleX();
+ float scaleY = view.getScaleY();
Rect rect = drawable.getBounds();
int bitmapWidth = (int) (rect.width() * scaleX);
@@ -179,14 +174,11 @@ public class HolographicOutlineHelper {
}
int key = (bitmapWidth << 16) | bitmapHeight;
- Bitmap cache = shouldCache ? mBitmapCache.get(key) : null;
+ Bitmap cache = mBitmapCache.get(key);
if (cache == null) {
cache = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ALPHA_8);
mCanvas.setBitmap(cache);
-
- if (shouldCache) {
- mBitmapCache.put(key, cache);
- }
+ mBitmapCache.put(key, cache);
} else {
mCanvas.setBitmap(cache);
mCanvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR);
@@ -206,7 +198,7 @@ public class HolographicOutlineHelper {
int resultWidth = bitmapWidth + extraSize;
int resultHeight = bitmapHeight + extraSize;
key = (resultWidth << 16) | resultHeight;
- Bitmap result = shouldCache ? mBitmapCache.get(key) : null;
+ Bitmap result = mBitmapCache.get(key);
if (result == null) {
result = Bitmap.createBitmap(resultWidth, resultHeight, Bitmap.Config.ALPHA_8);
mCanvas.setBitmap(result);