Loading api/current.xml +29 −19 Original line number Diff line number Diff line Loading @@ -75752,6 +75752,16 @@ visibility="public" > </method> <field name="inBitmap" type="android.graphics.Bitmap" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inDensity" type="int" transient="false" Loading Loading @@ -250580,7 +250590,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="arg0" type="T"> <parameter name="t" type="T"> </parameter> </method> </interface> Loading Loading @@ -264830,9 +264840,9 @@ deprecated="not deprecated" visibility="public" > <parameter name="beginIndex" type="int"> <parameter name="start" type="int"> </parameter> <parameter name="endIndex" type="int"> <parameter name="end" type="int"> </parameter> </method> <method name="ensureCapacity" Loading Loading @@ -267530,7 +267540,7 @@ native="false" synchronized="false" static="true" final="true" final="false" deprecated="not deprecated" visibility="public" > Loading Loading @@ -273853,7 +273863,7 @@ </exception> </method> <method name="getClass" return="java.lang.Class<? extends java.lang.Object>" return="java.lang.Class<?>" abstract="false" native="true" synchronized="false" Loading Loading @@ -276643,9 +276653,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276659,9 +276669,9 @@ </parameter> <parameter name="high" type="int"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276673,9 +276683,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> <parameter name="charsetName" type="java.lang.String"> </parameter> Loading Loading @@ -276705,9 +276715,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> <parameter name="charset" type="java.nio.charset.Charset"> </parameter> Loading Loading @@ -276743,9 +276753,9 @@ > <parameter name="data" type="char[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="charCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276765,7 +276775,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="stringbuffer" type="java.lang.StringBuffer"> <parameter name="stringBuffer" type="java.lang.StringBuffer"> </parameter> </constructor> <constructor name="String" Loading @@ -276789,7 +276799,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="sb" type="java.lang.StringBuilder"> <parameter name="stringBuilder" type="java.lang.StringBuilder"> </parameter> </constructor> <method name="charAt" Loading Loading @@ -276841,9 +276851,9 @@ deprecated="not deprecated" visibility="public" > <parameter name="beginIndex" type="int"> <parameter name="start" type="int"> </parameter> <parameter name="endIndex" type="int"> <parameter name="end" type="int"> </parameter> </method> <method name="compareTo" core/java/android/animation/PropertyValuesHolder.java +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public class PropertyValuesHolder implements Cloneable { /** * The setter function, if needed. ObjectAnimator hands off this functionality to * PropertyValuesHolder, since it holds all of the per-property information. This * property can be manually set via setSetter(). Otherwise, it is automatically * property is automatically * derived when the animation starts in setupSetterAndGetter() if using ObjectAnimator. */ Method mSetter = null; Loading @@ -49,7 +49,7 @@ public class PropertyValuesHolder implements Cloneable { /** * The getter function, if needed. ObjectAnimator hands off this functionality to * PropertyValuesHolder, since it holds all of the per-property information. This * property can be manually set via setSetter(). Otherwise, it is automatically * property is automatically * derived when the animation starts in setupSetterAndGetter() if using ObjectAnimator. * The getter is only derived and used if one of the values is null. */ Loading core/jni/android/graphics/BitmapFactory.cpp +24 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ jfieldID gOptions_widthFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_mCancelID; jfieldID gOptions_bitmapFieldID; jclass gBitmap_class; jfieldID gBitmap_nativeBitmapFieldID; static jclass gFileDescriptor_class; static jfieldID gFileDescriptor_descriptor; Loading Loading @@ -187,6 +190,7 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, (allowPurgeable && optionsPurgeable(env, options)); bool reportSizeToVM = optionsReportSizeToVM(env, options); bool preferQualityOverSpeed = false; jobject javaBitmap = NULL; if (NULL != options) { sampleSize = env->GetIntField(options, gOptions_sampleSizeFieldID); Loading @@ -203,6 +207,7 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, doDither = env->GetBooleanField(options, gOptions_ditherFieldID); preferQualityOverSpeed = env->GetBooleanField(options, gOptions_preferQualityOverSpeedFieldID); javaBitmap = env->GetObjectField(options, gOptions_bitmapFieldID); } SkImageDecoder* decoder = SkImageDecoder::Factory(stream); Loading @@ -216,7 +221,14 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, NinePatchPeeker peeker(decoder); JavaPixelAllocator javaAllocator(env, reportSizeToVM); SkBitmap* bitmap = new SkBitmap; SkBitmap* bitmap; if (javaBitmap == NULL) { bitmap = new SkBitmap; } else { bitmap = (SkBitmap *) env->GetIntField(javaBitmap, gBitmap_nativeBitmapFieldID); // config of supplied bitmap overrules config set in options prefConfig = bitmap->getConfig(); } Res_png_9patch dummy9Patch; SkAutoTDelete<SkImageDecoder> add(decoder); Loading @@ -233,14 +245,14 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, // happens earlier than AutoDecoderCancel object is added // to the gAutoDecoderCancelMutex linked list. if (NULL != options && env->GetBooleanField(options, gOptions_mCancelID)) { return nullObjectReturn("gOptions_mCancelID");; return nullObjectReturn("gOptions_mCancelID"); } SkImageDecoder::Mode decodeMode = mode; if (isPurgeable) { decodeMode = SkImageDecoder::kDecodeBounds_Mode; } if (!decoder->decode(stream, bitmap, prefConfig, decodeMode)) { if (!decoder->decode(stream, bitmap, prefConfig, decodeMode, javaBitmap != NULL)) { return nullObjectReturn("decoder->decode returned false"); } Loading Loading @@ -301,6 +313,11 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, } // promise we will never change our pixels (great for sharing and pictures) pr->setImmutable(); if (javaBitmap != NULL) { // If a java bitmap was passed in for reuse, pass it back return javaBitmap; } // now create the java bitmap return GraphicsJNI::createBitmap(env, bitmap, false, ninePatchChunk); } Loading Loading @@ -554,6 +571,8 @@ static jfieldID getFieldIDCheck(JNIEnv* env, jclass clazz, int register_android_graphics_BitmapFactory(JNIEnv* env); int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_class = make_globalref(env, "android/graphics/BitmapFactory$Options"); gOptions_bitmapFieldID = getFieldIDCheck(env, gOptions_class, "inBitmap", "Landroid/graphics/Bitmap;"); gOptions_justBoundsFieldID = getFieldIDCheck(env, gOptions_class, "inJustDecodeBounds", "Z"); gOptions_sampleSizeFieldID = getFieldIDCheck(env, gOptions_class, "inSampleSize", "I"); gOptions_configFieldID = getFieldIDCheck(env, gOptions_class, "inPreferredConfig", Loading @@ -569,6 +588,8 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_mimeFieldID = getFieldIDCheck(env, gOptions_class, "outMimeType", "Ljava/lang/String;"); gOptions_mCancelID = getFieldIDCheck(env, gOptions_class, "mCancel", "Z"); gBitmap_class = make_globalref(env, "android/graphics/Bitmap"); gBitmap_nativeBitmapFieldID = getFieldIDCheck(env, gBitmap_class, "mNativeBitmap", "I"); gFileDescriptor_class = make_globalref(env, "java/io/FileDescriptor"); gFileDescriptor_descriptor = getFieldIDCheck(env, gFileDescriptor_class, "descriptor", "I"); Loading graphics/java/android/graphics/BitmapFactory.java +20 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,26 @@ public class BitmapFactory { inScaled = true; } /** * If set, decode methods that take the Options object will attempt to * reuse this bitmap when loading content. This is a hint to the decoder * only, and the decoder may choose to create a new Bitmap instead. The * current implementation necessitates that the reused bitmap be of the * same size as the source content and in jpeg format (whether as a * resource or as a stream). The {@link android.graphics.Bitmap.Config * configuration} of the reused bitmap will override the setting of * {@link #inPreferredConfig}, if set. * * <p>You should still always use the returned Bitmap of the decode * method and not assume that reusing the bitmap worked, due to the * constraints outlined above and failure situations that can occur. * Checking whether the return value matches the value of the inBitmap * set in the Options structure is a way to see if the bitmap was reused, * but in all cases you should use the returned Bitmap to make sure * that you are using the bitmap that was used as the decode destination.</p> */ public Bitmap inBitmap; /** * If set to true, the decoder will return null (no bitmap), but * the out... fields will still be set, allowing the caller to query Loading Loading
api/current.xml +29 −19 Original line number Diff line number Diff line Loading @@ -75752,6 +75752,16 @@ visibility="public" > </method> <field name="inBitmap" type="android.graphics.Bitmap" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inDensity" type="int" transient="false" Loading Loading @@ -250580,7 +250590,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="arg0" type="T"> <parameter name="t" type="T"> </parameter> </method> </interface> Loading Loading @@ -264830,9 +264840,9 @@ deprecated="not deprecated" visibility="public" > <parameter name="beginIndex" type="int"> <parameter name="start" type="int"> </parameter> <parameter name="endIndex" type="int"> <parameter name="end" type="int"> </parameter> </method> <method name="ensureCapacity" Loading Loading @@ -267530,7 +267540,7 @@ native="false" synchronized="false" static="true" final="true" final="false" deprecated="not deprecated" visibility="public" > Loading Loading @@ -273853,7 +273863,7 @@ </exception> </method> <method name="getClass" return="java.lang.Class<? extends java.lang.Object>" return="java.lang.Class<?>" abstract="false" native="true" synchronized="false" Loading Loading @@ -276643,9 +276653,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276659,9 +276669,9 @@ </parameter> <parameter name="high" type="int"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276673,9 +276683,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> <parameter name="charsetName" type="java.lang.String"> </parameter> Loading Loading @@ -276705,9 +276715,9 @@ > <parameter name="data" type="byte[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="byteCount" type="int"> </parameter> <parameter name="charset" type="java.nio.charset.Charset"> </parameter> Loading Loading @@ -276743,9 +276753,9 @@ > <parameter name="data" type="char[]"> </parameter> <parameter name="start" type="int"> <parameter name="offset" type="int"> </parameter> <parameter name="length" type="int"> <parameter name="charCount" type="int"> </parameter> </constructor> <constructor name="String" Loading @@ -276765,7 +276775,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="stringbuffer" type="java.lang.StringBuffer"> <parameter name="stringBuffer" type="java.lang.StringBuffer"> </parameter> </constructor> <constructor name="String" Loading @@ -276789,7 +276799,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="sb" type="java.lang.StringBuilder"> <parameter name="stringBuilder" type="java.lang.StringBuilder"> </parameter> </constructor> <method name="charAt" Loading Loading @@ -276841,9 +276851,9 @@ deprecated="not deprecated" visibility="public" > <parameter name="beginIndex" type="int"> <parameter name="start" type="int"> </parameter> <parameter name="endIndex" type="int"> <parameter name="end" type="int"> </parameter> </method> <method name="compareTo"
core/java/android/animation/PropertyValuesHolder.java +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public class PropertyValuesHolder implements Cloneable { /** * The setter function, if needed. ObjectAnimator hands off this functionality to * PropertyValuesHolder, since it holds all of the per-property information. This * property can be manually set via setSetter(). Otherwise, it is automatically * property is automatically * derived when the animation starts in setupSetterAndGetter() if using ObjectAnimator. */ Method mSetter = null; Loading @@ -49,7 +49,7 @@ public class PropertyValuesHolder implements Cloneable { /** * The getter function, if needed. ObjectAnimator hands off this functionality to * PropertyValuesHolder, since it holds all of the per-property information. This * property can be manually set via setSetter(). Otherwise, it is automatically * property is automatically * derived when the animation starts in setupSetterAndGetter() if using ObjectAnimator. * The getter is only derived and used if one of the values is null. */ Loading
core/jni/android/graphics/BitmapFactory.cpp +24 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ jfieldID gOptions_widthFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_mCancelID; jfieldID gOptions_bitmapFieldID; jclass gBitmap_class; jfieldID gBitmap_nativeBitmapFieldID; static jclass gFileDescriptor_class; static jfieldID gFileDescriptor_descriptor; Loading Loading @@ -187,6 +190,7 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, (allowPurgeable && optionsPurgeable(env, options)); bool reportSizeToVM = optionsReportSizeToVM(env, options); bool preferQualityOverSpeed = false; jobject javaBitmap = NULL; if (NULL != options) { sampleSize = env->GetIntField(options, gOptions_sampleSizeFieldID); Loading @@ -203,6 +207,7 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, doDither = env->GetBooleanField(options, gOptions_ditherFieldID); preferQualityOverSpeed = env->GetBooleanField(options, gOptions_preferQualityOverSpeedFieldID); javaBitmap = env->GetObjectField(options, gOptions_bitmapFieldID); } SkImageDecoder* decoder = SkImageDecoder::Factory(stream); Loading @@ -216,7 +221,14 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, NinePatchPeeker peeker(decoder); JavaPixelAllocator javaAllocator(env, reportSizeToVM); SkBitmap* bitmap = new SkBitmap; SkBitmap* bitmap; if (javaBitmap == NULL) { bitmap = new SkBitmap; } else { bitmap = (SkBitmap *) env->GetIntField(javaBitmap, gBitmap_nativeBitmapFieldID); // config of supplied bitmap overrules config set in options prefConfig = bitmap->getConfig(); } Res_png_9patch dummy9Patch; SkAutoTDelete<SkImageDecoder> add(decoder); Loading @@ -233,14 +245,14 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, // happens earlier than AutoDecoderCancel object is added // to the gAutoDecoderCancelMutex linked list. if (NULL != options && env->GetBooleanField(options, gOptions_mCancelID)) { return nullObjectReturn("gOptions_mCancelID");; return nullObjectReturn("gOptions_mCancelID"); } SkImageDecoder::Mode decodeMode = mode; if (isPurgeable) { decodeMode = SkImageDecoder::kDecodeBounds_Mode; } if (!decoder->decode(stream, bitmap, prefConfig, decodeMode)) { if (!decoder->decode(stream, bitmap, prefConfig, decodeMode, javaBitmap != NULL)) { return nullObjectReturn("decoder->decode returned false"); } Loading Loading @@ -301,6 +313,11 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, } // promise we will never change our pixels (great for sharing and pictures) pr->setImmutable(); if (javaBitmap != NULL) { // If a java bitmap was passed in for reuse, pass it back return javaBitmap; } // now create the java bitmap return GraphicsJNI::createBitmap(env, bitmap, false, ninePatchChunk); } Loading Loading @@ -554,6 +571,8 @@ static jfieldID getFieldIDCheck(JNIEnv* env, jclass clazz, int register_android_graphics_BitmapFactory(JNIEnv* env); int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_class = make_globalref(env, "android/graphics/BitmapFactory$Options"); gOptions_bitmapFieldID = getFieldIDCheck(env, gOptions_class, "inBitmap", "Landroid/graphics/Bitmap;"); gOptions_justBoundsFieldID = getFieldIDCheck(env, gOptions_class, "inJustDecodeBounds", "Z"); gOptions_sampleSizeFieldID = getFieldIDCheck(env, gOptions_class, "inSampleSize", "I"); gOptions_configFieldID = getFieldIDCheck(env, gOptions_class, "inPreferredConfig", Loading @@ -569,6 +588,8 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_mimeFieldID = getFieldIDCheck(env, gOptions_class, "outMimeType", "Ljava/lang/String;"); gOptions_mCancelID = getFieldIDCheck(env, gOptions_class, "mCancel", "Z"); gBitmap_class = make_globalref(env, "android/graphics/Bitmap"); gBitmap_nativeBitmapFieldID = getFieldIDCheck(env, gBitmap_class, "mNativeBitmap", "I"); gFileDescriptor_class = make_globalref(env, "java/io/FileDescriptor"); gFileDescriptor_descriptor = getFieldIDCheck(env, gFileDescriptor_class, "descriptor", "I"); Loading
graphics/java/android/graphics/BitmapFactory.java +20 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,26 @@ public class BitmapFactory { inScaled = true; } /** * If set, decode methods that take the Options object will attempt to * reuse this bitmap when loading content. This is a hint to the decoder * only, and the decoder may choose to create a new Bitmap instead. The * current implementation necessitates that the reused bitmap be of the * same size as the source content and in jpeg format (whether as a * resource or as a stream). The {@link android.graphics.Bitmap.Config * configuration} of the reused bitmap will override the setting of * {@link #inPreferredConfig}, if set. * * <p>You should still always use the returned Bitmap of the decode * method and not assume that reusing the bitmap worked, due to the * constraints outlined above and failure situations that can occur. * Checking whether the return value matches the value of the inBitmap * set in the Options structure is a way to see if the bitmap was reused, * but in all cases you should use the returned Bitmap to make sure * that you are using the bitmap that was used as the decode destination.</p> */ public Bitmap inBitmap; /** * If set to true, the decoder will return null (no bitmap), but * the out... fields will still be set, allowing the caller to query Loading