Disabling certain effects (wallpaper transition, holographic icons in AllApps) if HW acceleration is not enabled.

Change-Id: I7926d5c3ba95c6d57999189677ff79f67b05434f
This commit is contained in:
Winson Chung
2011-04-22 14:13:05 -07:00
parent 876668c132
commit b46a2d130b
3 changed files with 79 additions and 62 deletions

View File

@@ -57,6 +57,7 @@ public class PagedViewIcon extends CachedTextView implements Checkable {
private int mAlpha = 255;
private int mHolographicAlpha;
private boolean mHolographicEffectsEnabled;
private boolean mIsChecked;
private ObjectAnimator mCheckedAlphaAnimator;
private float mCheckedAlpha = 1.0f;
@@ -132,6 +133,7 @@ public class PagedViewIcon extends CachedTextView implements Checkable {
}
mHolographicOutlineView = new HolographicPagedViewIcon(context, this);
mHolographicEffectsEnabled = isHardwareAccelerated();
}
protected HolographicPagedViewIcon getHolographicOutlineView() {
@@ -164,7 +166,7 @@ public class PagedViewIcon extends CachedTextView implements Checkable {
mIconCache = cache;
mIconCacheKey = new PagedViewIconCache.Key(info);
mHolographicOutline = mIconCache.getOutline(mIconCacheKey);
if (!queueHolographicOutlineCreation()) {
if (mHolographicEffectsEnabled && !queueHolographicOutlineCreation()) {
getHolographicOutlineView().invalidate();
}
}
@@ -182,7 +184,7 @@ public class PagedViewIcon extends CachedTextView implements Checkable {
mIconCache = cache;
mIconCacheKey = new PagedViewIconCache.Key(info);
mHolographicOutline = mIconCache.getOutline(mIconCacheKey);
if (!queueHolographicOutlineCreation()) {
if (mHolographicEffectsEnabled && !queueHolographicOutlineCreation()) {
getHolographicOutlineView().invalidate();
}
}
@@ -218,7 +220,8 @@ public class PagedViewIcon extends CachedTextView implements Checkable {
// draw any blended overlays
if (mCheckedOutline == null) {
if (mHolographicOutline != null && mHolographicAlpha > 0) {
if (mHolographicEffectsEnabled && mHolographicOutline != null
&& mHolographicAlpha > 0) {
mPaint.setAlpha(mHolographicAlpha);
overlay = mHolographicOutline;
}