summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/HolographicOutlineHelper.java
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2013-06-12 22:46:02 -0400
committerDaniel Sandler <dsandler@android.com>2013-06-12 22:46:02 -0400
commite572fe46f75adfb1adbf3c2a6812d1e3dbdee5e1 (patch)
tree855a6701f3cc3d6d2bca624d30b8b8961acb74d9 /src/com/android/launcher3/HolographicOutlineHelper.java
parentc6e2f94fbace46b11d0ee57fed16c327d83262d4 (diff)
downloadandroid_packages_apps_Trebuchet-e572fe46f75adfb1adbf3c2a6812d1e3dbdee5e1.tar.gz
android_packages_apps_Trebuchet-e572fe46f75adfb1adbf3c2a6812d1e3dbdee5e1.tar.bz2
android_packages_apps_Trebuchet-e572fe46f75adfb1adbf3c2a6812d1e3dbdee5e1.zip
Make HolographicOutlineHelper a singleton.
It's a pretty heavy object, including three Paints at 74 bytes apiece, and we allocate one for every workspace and every icon. We really only need one. Change-Id: Ic9e12d478c3be27b13133718875c91540f7ccf4c
Diffstat (limited to 'src/com/android/launcher3/HolographicOutlineHelper.java')
-rw-r--r--src/com/android/launcher3/HolographicOutlineHelper.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/HolographicOutlineHelper.java b/src/com/android/launcher3/HolographicOutlineHelper.java
index 0344cd537..47c40b657 100644
--- a/src/com/android/launcher3/HolographicOutlineHelper.java
+++ b/src/com/android/launcher3/HolographicOutlineHelper.java
@@ -43,6 +43,8 @@ public class HolographicOutlineHelper {
private static final int MEDIUM = 1;
private static final int EXTRA_THICK = 2;
+ static HolographicOutlineHelper INSTANCE;
+
static {
final float scale = LauncherAppState.getScreenDensity();
@@ -56,9 +58,11 @@ public class HolographicOutlineHelper {
sExtraThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.NORMAL);
sThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL);
sMediumInnerBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.NORMAL);
+
+ INSTANCE = new HolographicOutlineHelper();
}
- HolographicOutlineHelper() {
+ private HolographicOutlineHelper() {
mHolographicPaint.setFilterBitmap(true);
mHolographicPaint.setAntiAlias(true);
mBlurPaint.setFilterBitmap(true);
@@ -68,6 +72,10 @@ public class HolographicOutlineHelper {
mErasePaint.setAntiAlias(true);
}
+ public static HolographicOutlineHelper obtain() {
+ return INSTANCE;
+ }
+
/**
* Returns the interpolated holographic highlight alpha for the effect we want when scrolling
* pages.