Loading graphics/java/android/graphics/drawable/RippleBackground.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -48,8 +48,8 @@ class RippleBackground extends RippleComponent { // Software rendering properties. // Software rendering properties. private float mOpacity = 0; private float mOpacity = 0; public RippleBackground(RippleDrawable owner, Rect bounds) { public RippleBackground(RippleDrawable owner, Rect bounds, boolean forceSoftware) { super(owner, bounds); super(owner, bounds, forceSoftware); } } public boolean isVisible() { public boolean isVisible() { Loading graphics/java/android/graphics/drawable/RippleComponent.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -52,9 +52,16 @@ abstract class RippleComponent { /** Screen density used to adjust pixel-based constants. */ /** Screen density used to adjust pixel-based constants. */ protected float mDensity; protected float mDensity; public RippleComponent(RippleDrawable owner, Rect bounds) { /** * If set, force all ripple animations to not run on RenderThread, even if it would be * available. */ private final boolean mForceSoftware; public RippleComponent(RippleDrawable owner, Rect bounds, boolean forceSoftware) { mOwner = owner; mOwner = owner; mBounds = bounds; mBounds = bounds; mForceSoftware = forceSoftware; } } public void onBoundsChange() { public void onBoundsChange() { Loading Loading @@ -143,7 +150,7 @@ abstract class RippleComponent { * @return {@code true} if something was drawn, {@code false} otherwise * @return {@code true} if something was drawn, {@code false} otherwise */ */ public boolean draw(Canvas c, Paint p) { public boolean draw(Canvas c, Paint p) { final boolean hasDisplayListCanvas = c.isHardwareAccelerated() final boolean hasDisplayListCanvas = !mForceSoftware && c.isHardwareAccelerated() && c instanceof DisplayListCanvas; && c instanceof DisplayListCanvas; if (mHasDisplayListCanvas != hasDisplayListCanvas) { if (mHasDisplayListCanvas != hasDisplayListCanvas) { mHasDisplayListCanvas = hasDisplayListCanvas; mHasDisplayListCanvas = hasDisplayListCanvas; Loading graphics/java/android/graphics/drawable/RippleDrawable.java +18 −2 Original line number Original line Diff line number Diff line Loading @@ -165,6 +165,12 @@ public class RippleDrawable extends LayerDrawable { /** Whether bounds are being overridden. */ /** Whether bounds are being overridden. */ private boolean mOverrideBounds; private boolean mOverrideBounds; /** * If set, force all ripple animations to not run on RenderThread, even if it would be * available. */ private boolean mForceSoftware; /** /** * Constructor used for drawable inflation. * Constructor used for drawable inflation. */ */ Loading Loading @@ -546,7 +552,7 @@ public class RippleDrawable extends LayerDrawable { */ */ private void tryBackgroundEnter(boolean focused) { private void tryBackgroundEnter(boolean focused) { if (mBackground == null) { if (mBackground == null) { mBackground = new RippleBackground(this, mHotspotBounds); mBackground = new RippleBackground(this, mHotspotBounds, mForceSoftware); } } mBackground.setup(mState.mMaxRadius, mDensity); mBackground.setup(mState.mMaxRadius, mDensity); Loading Loading @@ -584,7 +590,7 @@ public class RippleDrawable extends LayerDrawable { } } final boolean isBounded = isBounded(); final boolean isBounded = isBounded(); mRipple = new RippleForeground(this, mHotspotBounds, x, y, isBounded); mRipple = new RippleForeground(this, mHotspotBounds, x, y, isBounded, mForceSoftware); } } mRipple.setup(mState.mMaxRadius, mDensity); mRipple.setup(mState.mMaxRadius, mDensity); Loading Loading @@ -949,6 +955,16 @@ public class RippleDrawable extends LayerDrawable { } } } } /** * Sets whether to disable RenderThread animations for this ripple. * * @param forceSoftware true if RenderThread animations should be disabled, false otherwise * @hide */ public void setForceSoftware(boolean forceSoftware) { mForceSoftware = forceSoftware; } @Override @Override public ConstantState getConstantState() { public ConstantState getConstantState() { return mState; return mState; Loading graphics/java/android/graphics/drawable/RippleForeground.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -87,8 +87,8 @@ class RippleForeground extends RippleComponent { private boolean mHasFinishedExit; private boolean mHasFinishedExit; public RippleForeground(RippleDrawable owner, Rect bounds, float startingX, float startingY, public RippleForeground(RippleDrawable owner, Rect bounds, float startingX, float startingY, boolean isBounded) { boolean isBounded, boolean forceSoftware) { super(owner, bounds); super(owner, bounds, forceSoftware); mIsBounded = isBounded; mIsBounded = isBounded; mStartingX = startingX; mStartingX = startingX; Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.util.AttributeSet; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.MotionEvent; Loading Loading
graphics/java/android/graphics/drawable/RippleBackground.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -48,8 +48,8 @@ class RippleBackground extends RippleComponent { // Software rendering properties. // Software rendering properties. private float mOpacity = 0; private float mOpacity = 0; public RippleBackground(RippleDrawable owner, Rect bounds) { public RippleBackground(RippleDrawable owner, Rect bounds, boolean forceSoftware) { super(owner, bounds); super(owner, bounds, forceSoftware); } } public boolean isVisible() { public boolean isVisible() { Loading
graphics/java/android/graphics/drawable/RippleComponent.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -52,9 +52,16 @@ abstract class RippleComponent { /** Screen density used to adjust pixel-based constants. */ /** Screen density used to adjust pixel-based constants. */ protected float mDensity; protected float mDensity; public RippleComponent(RippleDrawable owner, Rect bounds) { /** * If set, force all ripple animations to not run on RenderThread, even if it would be * available. */ private final boolean mForceSoftware; public RippleComponent(RippleDrawable owner, Rect bounds, boolean forceSoftware) { mOwner = owner; mOwner = owner; mBounds = bounds; mBounds = bounds; mForceSoftware = forceSoftware; } } public void onBoundsChange() { public void onBoundsChange() { Loading Loading @@ -143,7 +150,7 @@ abstract class RippleComponent { * @return {@code true} if something was drawn, {@code false} otherwise * @return {@code true} if something was drawn, {@code false} otherwise */ */ public boolean draw(Canvas c, Paint p) { public boolean draw(Canvas c, Paint p) { final boolean hasDisplayListCanvas = c.isHardwareAccelerated() final boolean hasDisplayListCanvas = !mForceSoftware && c.isHardwareAccelerated() && c instanceof DisplayListCanvas; && c instanceof DisplayListCanvas; if (mHasDisplayListCanvas != hasDisplayListCanvas) { if (mHasDisplayListCanvas != hasDisplayListCanvas) { mHasDisplayListCanvas = hasDisplayListCanvas; mHasDisplayListCanvas = hasDisplayListCanvas; Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +18 −2 Original line number Original line Diff line number Diff line Loading @@ -165,6 +165,12 @@ public class RippleDrawable extends LayerDrawable { /** Whether bounds are being overridden. */ /** Whether bounds are being overridden. */ private boolean mOverrideBounds; private boolean mOverrideBounds; /** * If set, force all ripple animations to not run on RenderThread, even if it would be * available. */ private boolean mForceSoftware; /** /** * Constructor used for drawable inflation. * Constructor used for drawable inflation. */ */ Loading Loading @@ -546,7 +552,7 @@ public class RippleDrawable extends LayerDrawable { */ */ private void tryBackgroundEnter(boolean focused) { private void tryBackgroundEnter(boolean focused) { if (mBackground == null) { if (mBackground == null) { mBackground = new RippleBackground(this, mHotspotBounds); mBackground = new RippleBackground(this, mHotspotBounds, mForceSoftware); } } mBackground.setup(mState.mMaxRadius, mDensity); mBackground.setup(mState.mMaxRadius, mDensity); Loading Loading @@ -584,7 +590,7 @@ public class RippleDrawable extends LayerDrawable { } } final boolean isBounded = isBounded(); final boolean isBounded = isBounded(); mRipple = new RippleForeground(this, mHotspotBounds, x, y, isBounded); mRipple = new RippleForeground(this, mHotspotBounds, x, y, isBounded, mForceSoftware); } } mRipple.setup(mState.mMaxRadius, mDensity); mRipple.setup(mState.mMaxRadius, mDensity); Loading Loading @@ -949,6 +955,16 @@ public class RippleDrawable extends LayerDrawable { } } } } /** * Sets whether to disable RenderThread animations for this ripple. * * @param forceSoftware true if RenderThread animations should be disabled, false otherwise * @hide */ public void setForceSoftware(boolean forceSoftware) { mForceSoftware = forceSoftware; } @Override @Override public ConstantState getConstantState() { public ConstantState getConstantState() { return mState; return mState; Loading
graphics/java/android/graphics/drawable/RippleForeground.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -87,8 +87,8 @@ class RippleForeground extends RippleComponent { private boolean mHasFinishedExit; private boolean mHasFinishedExit; public RippleForeground(RippleDrawable owner, Rect bounds, float startingX, float startingY, public RippleForeground(RippleDrawable owner, Rect bounds, float startingX, float startingY, boolean isBounded) { boolean isBounded, boolean forceSoftware) { super(owner, bounds); super(owner, bounds, forceSoftware); mIsBounded = isBounded; mIsBounded = isBounded; mStartingX = startingX; mStartingX = startingX; Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.util.AttributeSet; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.MotionEvent; Loading