diff options
author | Chris Craik <ccraik@google.com> | 2015-03-10 10:28:59 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-03-10 14:56:11 -0700 |
commit | f6829a0a618b4523619ec53c996b04d67e3186b9 (patch) | |
tree | 816816dadc5cd7ac8ad1b6a309525f6300fc9b82 /graphics | |
parent | edacf22ca132ac48207a68aa30998f5b43d893b8 (diff) | |
download | frameworks_base-f6829a0a618b4523619ec53c996b04d67e3186b9.zip frameworks_base-f6829a0a618b4523619ec53c996b04d67e3186b9.tar.gz frameworks_base-f6829a0a618b4523619ec53c996b04d67e3186b9.tar.bz2 |
Remove HardwareCanvas
Change-Id: I239646a7f00f09d3f76fe6b6162eed86bc0d6e77
Diffstat (limited to 'graphics')
3 files changed, 17 insertions, 17 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleBackground.java b/graphics/java/android/graphics/drawable/RippleBackground.java index 6d1b1fe..1c14e2f 100644 --- a/graphics/java/android/graphics/drawable/RippleBackground.java +++ b/graphics/java/android/graphics/drawable/RippleBackground.java @@ -25,7 +25,7 @@ import android.graphics.CanvasProperty; import android.graphics.Paint; import android.graphics.Rect; import android.util.FloatProperty; -import android.view.HardwareCanvas; +import android.view.DisplayListCanvas; import android.view.RenderNodeAnimator; import android.view.animation.LinearInterpolator; @@ -73,7 +73,7 @@ class RippleBackground extends RippleComponent { } @Override - protected boolean drawHardware(HardwareCanvas c) { + protected boolean drawHardware(DisplayListCanvas c) { c.drawCircle(mPropX, mPropY, mPropRadius, mPropPaint); return true; } diff --git a/graphics/java/android/graphics/drawable/RippleComponent.java b/graphics/java/android/graphics/drawable/RippleComponent.java index fd3e06c..e8ee8ad 100644 --- a/graphics/java/android/graphics/drawable/RippleComponent.java +++ b/graphics/java/android/graphics/drawable/RippleComponent.java @@ -20,7 +20,7 @@ import android.animation.Animator; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; -import android.view.HardwareCanvas; +import android.view.DisplayListCanvas; import android.view.RenderNodeAnimator; import java.util.ArrayList; @@ -36,7 +36,7 @@ abstract class RippleComponent { protected final Rect mBounds; /** Whether we can use hardware acceleration for the exit animation. */ - private boolean mHasHardwareCanvas; + private boolean mHasDisplayListCanvas; private boolean mHasPendingHardwareAnimator; private RenderNodeAnimatorSet mHardwareAnimator; @@ -91,7 +91,7 @@ abstract class RippleComponent { public final void exit() { cancel(); - if (mHasHardwareCanvas) { + if (mHasDisplayListCanvas) { // We don't have access to a canvas here, but we expect one on the // next frame. We'll start the render thread animation then. mHasPendingHardwareAnimator = true; @@ -130,19 +130,19 @@ abstract class RippleComponent { * @return {@code true} if something was drawn, {@code false} otherwise */ public boolean draw(Canvas c, Paint p) { - final boolean hasHardwareCanvas = c.isHardwareAccelerated() - && c instanceof HardwareCanvas; - if (mHasHardwareCanvas != hasHardwareCanvas) { - mHasHardwareCanvas = hasHardwareCanvas; + final boolean hasDisplayListCanvas = c.isHardwareAccelerated() + && c instanceof DisplayListCanvas; + if (mHasDisplayListCanvas != hasDisplayListCanvas) { + mHasDisplayListCanvas = hasDisplayListCanvas; - if (!hasHardwareCanvas) { + if (!hasDisplayListCanvas) { // We've switched from hardware to non-hardware mode. Panic. endHardwareAnimations(); } } - if (hasHardwareCanvas) { - final HardwareCanvas hw = (HardwareCanvas) c; + if (hasDisplayListCanvas) { + final DisplayListCanvas hw = (DisplayListCanvas) c; startPendingAnimation(hw, p); if (mHardwareAnimator != null) { @@ -171,7 +171,7 @@ abstract class RippleComponent { * @param hw hardware canvas on which the animation should draw * @param p paint whose properties the hardware canvas should use */ - private void startPendingAnimation(HardwareCanvas hw, Paint p) { + private void startPendingAnimation(DisplayListCanvas hw, Paint p) { if (mHasPendingHardwareAnimator) { mHasPendingHardwareAnimator = false; @@ -264,7 +264,7 @@ abstract class RippleComponent { protected abstract RenderNodeAnimatorSet createHardwareExit(Paint p); - protected abstract boolean drawHardware(HardwareCanvas c); + protected abstract boolean drawHardware(DisplayListCanvas c); protected abstract boolean drawSoftware(Canvas c, Paint p); @@ -285,7 +285,7 @@ abstract class RippleComponent { mAnimators.clear(); } - public void start(HardwareCanvas target) { + public void start(DisplayListCanvas target) { if (target == null) { throw new IllegalArgumentException("Hardware canvas must be non-null"); } diff --git a/graphics/java/android/graphics/drawable/RippleForeground.java b/graphics/java/android/graphics/drawable/RippleForeground.java index 2023f04..ec59b41 100644 --- a/graphics/java/android/graphics/drawable/RippleForeground.java +++ b/graphics/java/android/graphics/drawable/RippleForeground.java @@ -27,7 +27,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.util.FloatProperty; import android.util.MathUtils; -import android.view.HardwareCanvas; +import android.view.DisplayListCanvas; import android.view.RenderNodeAnimator; import android.view.animation.LinearInterpolator; @@ -111,7 +111,7 @@ class RippleForeground extends RippleComponent { } @Override - protected boolean drawHardware(HardwareCanvas c) { + protected boolean drawHardware(DisplayListCanvas c) { c.drawCircle(mPropX, mPropY, mPropRadius, mPropPaint); return true; } |