From d05e64cf9f9b1542ccdac8675c63b8b185c97a48 Mon Sep 17 00:00:00 2001 From: Sam Blitzstein Date: Tue, 15 Jul 2014 16:48:21 -0700 Subject: Allow BitmapDrawables to use different DecodeStrategys Change-Id: I1736cf1ba0a5a9dd7d08a013a89ad5a705529f3c --- src/com/android/bitmap/drawable/BasicBitmapDrawable.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/com/android/bitmap') diff --git a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java index 5de0840..d637a98 100644 --- a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java +++ b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java @@ -304,12 +304,19 @@ public class BasicBitmapDrawable extends Drawable implements DecodeCallback, mTask.cancel(); } final DecodeOptions opts = new DecodeOptions(bufferW, bufferH, getDecodeVerticalCenter(), - DecodeOptions.STRATEGY_ROUND_NEAREST); + getDecodeStrategy()); mTask = new DecodeTask(mCurrKey, opts, factory, this, mCache); mTask.executeOnExecutor(getExecutor()); Trace.endSection(); } + /** + * Return one of the STRATEGY constants in {@link DecodeOptions}. + */ + protected int getDecodeStrategy() { + return DecodeOptions.STRATEGY_ROUND_NEAREST; + } + protected Executor getExecutor() { return EXECUTOR; } -- cgit v1.2.3