summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Sarett <msarett@google.com> 2015-12-18 13:07:01 -0500
committer Matt Sarett <msarett@google.com> 2016-01-04 17:20:17 -0500
commit5e2496bcee239ce9ebeff6022b7badf81d87492c (patch)
tree378b283d57c77b92b8d1f941c9935ba9ec99b3f9
parentca9c0d428aebd0506d7cd13e4a6d3c0e99f35233 (diff)
Make BitmapFactory.Options API Changes
This changes the documentation for inPreferQualityOverSpeed, inDither, and requestCancelDecode(). These changes are a result of modifying the backends of BitmapFactory and BitmapRegionDecoder to be faster, higher quality, and to use standard libraries. BUG:26266063 BUG:25556965 Change-Id: I9008fd276a38c737e242bcc6930ffe4e36d9fd1d
-rw-r--r--api/current.txt6
-rw-r--r--api/system-current.txt6
-rw-r--r--api/test-current.txt6
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp10
-rw-r--r--graphics/java/android/graphics/BitmapFactory.java30
5 files changed, 28 insertions, 30 deletions
diff --git a/api/current.txt b/api/current.txt
index 622a8b7b203b..8c70378d218e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -11252,14 +11252,14 @@ package android.graphics {
public static class BitmapFactory.Options {
ctor public BitmapFactory.Options();
- method public void requestCancelDecode();
+ method public deprecated void requestCancelDecode();
field public android.graphics.Bitmap inBitmap;
field public int inDensity;
- field public boolean inDither;
+ field public deprecated boolean inDither;
field public deprecated boolean inInputShareable;
field public boolean inJustDecodeBounds;
field public boolean inMutable;
- field public boolean inPreferQualityOverSpeed;
+ field public deprecated boolean inPreferQualityOverSpeed;
field public android.graphics.Bitmap.Config inPreferredConfig;
field public boolean inPremultiplied;
field public deprecated boolean inPurgeable;
diff --git a/api/system-current.txt b/api/system-current.txt
index e51b7d58ac7b..e5a9fa3e5446 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -11613,14 +11613,14 @@ package android.graphics {
public static class BitmapFactory.Options {
ctor public BitmapFactory.Options();
- method public void requestCancelDecode();
+ method public deprecated void requestCancelDecode();
field public android.graphics.Bitmap inBitmap;
field public int inDensity;
- field public boolean inDither;
+ field public deprecated boolean inDither;
field public deprecated boolean inInputShareable;
field public boolean inJustDecodeBounds;
field public boolean inMutable;
- field public boolean inPreferQualityOverSpeed;
+ field public deprecated boolean inPreferQualityOverSpeed;
field public android.graphics.Bitmap.Config inPreferredConfig;
field public boolean inPremultiplied;
field public deprecated boolean inPurgeable;
diff --git a/api/test-current.txt b/api/test-current.txt
index 2377a9b87939..a2d93bea1c18 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -11252,14 +11252,14 @@ package android.graphics {
public static class BitmapFactory.Options {
ctor public BitmapFactory.Options();
- method public void requestCancelDecode();
+ method public deprecated void requestCancelDecode();
field public android.graphics.Bitmap inBitmap;
field public int inDensity;
- field public boolean inDither;
+ field public deprecated boolean inDither;
field public deprecated boolean inInputShareable;
field public boolean inJustDecodeBounds;
field public boolean inMutable;
- field public boolean inPreferQualityOverSpeed;
+ field public deprecated boolean inPreferQualityOverSpeed;
field public android.graphics.Bitmap.Config inPreferredConfig;
field public boolean inPremultiplied;
field public deprecated boolean inPurgeable;
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 88b3769a1691..12c900764966 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -587,10 +587,6 @@ static jobject nativeDecodeByteArray(JNIEnv* env, jobject, jbyteArray byteArray,
return doDecode(env, stream.release(), NULL, options);
}
-static void nativeRequestCancel(JNIEnv*, jobject joptions) {
- // Deprecated
-}
-
static jboolean nativeIsSeekable(JNIEnv* env, jobject, jobject fileDescriptor) {
jint descriptor = jniGetFDFromFileDescriptor(env, fileDescriptor);
return ::lseek64(descriptor, 0, SEEK_CUR) != -1 ? JNI_TRUE : JNI_FALSE;
@@ -630,10 +626,6 @@ static const JNINativeMethod gMethods[] = {
},
};
-static const JNINativeMethod gOptionsMethods[] = {
- { "requestCancel", "()V", (void*)nativeRequestCancel }
-};
-
int register_android_graphics_BitmapFactory(JNIEnv* env) {
jclass options_class = FindClassOrDie(env, "android/graphics/BitmapFactory$Options");
gOptions_bitmapFieldID = GetFieldIDOrDie(env, options_class, "inBitmap",
@@ -665,8 +657,6 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) {
gInsetStruct_constructorMethodID = GetMethodIDOrDie(env, gInsetStruct_class, "<init>",
"(IIIIIIIIFIF)V");
- android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory$Options",
- gOptionsMethods, NELEM(gOptionsMethods));
return android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory",
gMethods, NELEM(gMethods));
}
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index da58884e3833..175c726072cc 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -163,8 +163,11 @@ public class BitmapFactory {
public boolean inPremultiplied;
/**
- * If dither is true, the decoder will attempt to dither the decoded
- * image.
+ * @deprecated As of {@link android.os.Build.VERSION_CODES#N}, this is
+ * ignored.
+ *
+ * In {@link android.os.Build.VERSION_CODES#M} and below, if dither is
+ * true, the decoder will attempt to dither the decoded image.
*/
public boolean inDither;
@@ -308,7 +311,11 @@ public class BitmapFactory {
public boolean inInputShareable;
/**
- * If inPreferQualityOverSpeed is set to true, the decoder will try to
+ * @deprecated As of {@link android.os.Build.VERSION_CODES#N}, this is
+ * ignored. The output will always be high quality.
+ *
+ * In {@link android.os.Build.VERSION_CODES#M} and below, if
+ * inPreferQualityOverSpeed is set to true, the decoder will try to
* decode the reconstructed image to a higher quality even at the
* expense of the decoding speed. Currently the field only affects JPEG
* decode, in the case of which a more accurate, but slightly slower,
@@ -347,8 +354,6 @@ public class BitmapFactory {
*/
public byte[] inTempStorage;
- private native void requestCancel();
-
/**
* Flag to indicate that cancel has been called on this object. This
* is useful if there's an intermediary that wants to first decode the
@@ -359,16 +364,19 @@ public class BitmapFactory {
public boolean mCancel;
/**
- * This can be called from another thread while this options object is
- * inside a decode... call. Calling this will notify the decoder that
- * it should cancel its operation. This is not guaranteed to cancel
- * the decode, but if it does, the decoder... operation will return
- * null, or if inJustDecodeBounds is true, will set outWidth/outHeight
+ * @deprecated As of {@link android.os.Build.VERSION_CODES#N}, this
+ * will not affect the decode, though it will still set mCancel.
+ *
+ * In {@link android.os.Build.VERSION_CODES#M} and below, if this can
+ * be called from another thread while this options object is inside
+ * a decode... call. Calling this will notify the decoder that it
+ * should cancel its operation. This is not guaranteed to cancel the
+ * decode, but if it does, the decoder... operation will return null,
+ * or if inJustDecodeBounds is true, will set outWidth/outHeight
* to -1
*/
public void requestCancelDecode() {
mCancel = true;
- requestCancel();
}
}