summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Blitzstein <sblitz@google.com>2014-07-15 16:48:21 -0700
committerSam Blitzstein <sblitz@google.com>2014-07-15 21:04:09 -0700
commitd05e64cf9f9b1542ccdac8675c63b8b185c97a48 (patch)
tree37eb8d531d9f3fbe8e2602c6b9f63baa87b8552c
parentc5644927c0e7e121049b063046296ee8a59a4b37 (diff)
downloadbitmap-d05e64cf9f9b1542ccdac8675c63b8b185c97a48.tar.gz
Allow BitmapDrawables to use different DecodeStrategys
Change-Id: I1736cf1ba0a5a9dd7d08a013a89ad5a705529f3c
-rw-r--r--src/com/android/bitmap/drawable/BasicBitmapDrawable.java9
1 files changed, 8 insertions, 1 deletions
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;
}