Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -8263,6 +8263,7 @@ package android.graphics { method public int getScaledWidth(int); method public final int getWidth(); method public final boolean hasAlpha(); method public final boolean hasMipMap(); method public final boolean isMutable(); method public final boolean isPremultiplied(); method public final boolean isRecycled(); Loading @@ -8271,6 +8272,7 @@ package android.graphics { method public boolean sameAs(android.graphics.Bitmap); method public void setDensity(int); method public void setHasAlpha(boolean); method public final void setHasMipMap(boolean); method public void setPixel(int, int, int); method public void setPixels(int[], int, int, int, int, int, int); method public void writeToParcel(android.os.Parcel, int); core/jni/android/graphics/Bitmap.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -353,6 +353,15 @@ static void Bitmap_setHasAlpha(JNIEnv* env, jobject, SkBitmap* bitmap, bitmap->setIsOpaque(!hasAlpha); } static jboolean Bitmap_hasMipMap(JNIEnv* env, jobject, SkBitmap* bitmap) { return bitmap->hasHardwareMipMap(); } static void Bitmap_setHasMipMap(JNIEnv* env, jobject, SkBitmap* bitmap, jboolean hasMipMap) { bitmap->setHasHardwareMipMap(hasMipMap); } /////////////////////////////////////////////////////////////////////////////// static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) { Loading Loading @@ -666,6 +675,8 @@ static JNINativeMethod gBitmapMethods[] = { { "nativeConfig", "(I)I", (void*)Bitmap_config }, { "nativeHasAlpha", "(I)Z", (void*)Bitmap_hasAlpha }, { "nativeSetHasAlpha", "(IZ)V", (void*)Bitmap_setHasAlpha }, { "nativeHasMipMap", "(I)Z", (void*)Bitmap_hasMipMap }, { "nativeSetHasMipMap", "(IZ)V", (void*)Bitmap_setHasMipMap }, { "nativeCreateFromParcel", "(Landroid/os/Parcel;)Landroid/graphics/Bitmap;", (void*)Bitmap_createFromParcel }, Loading graphics/java/android/graphics/Bitmap.java +48 −1 Original line number Diff line number Diff line Loading @@ -1029,6 +1029,51 @@ public final class Bitmap implements Parcelable { nativeSetHasAlpha(mNativeBitmap, hasAlpha); } /** * Indicates whether the renderer responsible for drawing this * bitmap should attempt to use mipmaps when this bitmap is drawn * scaled down. * * If you know that you are going to draw this bitmap at less than * 50% of its original size, you may be able to obtain a higher * quality * * This property is only a suggestion that can be ignored by the * renderer. It is not guaranteed to have any effect. * * @return true if the renderer should attempt to use mipmaps, * false otherwise * * @see #setHasMipMap(boolean) */ public final boolean hasMipMap() { return nativeHasMipMap(mNativeBitmap); } /** * Set a hint for the renderer responsible for drawing this bitmap * indicating that it should attempt to use mipmaps when this bitmap * is drawn scaled down. * * If you know that you are going to draw this bitmap at less than * 50% of its original size, you may be able to obtain a higher * quality by turning this property on. * * Note that if the renderer respects this hint it might have to * allocate extra memory to hold the mipmap levels for this bitmap. * * This property is only a suggestion that can be ignored by the * renderer. It is not guaranteed to have any effect. * * @param hasMipMap indicates whether the renderer should attempt * to use mipmaps * * @see #hasMipMap() */ public final void setHasMipMap(boolean hasMipMap) { nativeSetHasMipMap(mNativeBitmap, hasMipMap); } /** * Fills the bitmap's pixels with the specified {@link Color}. * Loading Loading @@ -1356,7 +1401,6 @@ public final class Bitmap implements Parcelable { private static native int nativeHeight(int nativeBitmap); private static native int nativeRowBytes(int nativeBitmap); private static native int nativeConfig(int nativeBitmap); private static native boolean nativeHasAlpha(int nativeBitmap); private static native int nativeGetPixel(int nativeBitmap, int x, int y); private static native void nativeGetPixels(int nativeBitmap, int[] pixels, Loading Loading @@ -1385,7 +1429,10 @@ public final class Bitmap implements Parcelable { int[] offsetXY); private static native void nativePrepareToDraw(int nativeBitmap); private static native boolean nativeHasAlpha(int nativeBitmap); private static native void nativeSetHasAlpha(int nBitmap, boolean hasAlpha); private static native boolean nativeHasMipMap(int nativeBitmap); private static native void nativeSetHasMipMap(int nBitmap, boolean hasMipMap); private static native boolean nativeSameAs(int nb0, int nb1); /* package */ final int ni() { Loading libs/hwui/OpenGLRenderer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ namespace uirenderer { #define ALPHA_THRESHOLD 0 #define FILTER(paint) (paint && paint->isFilterBitmap() ? GL_LINEAR : GL_NEAREST) #define FILTER(paint) (!paint || paint->isFilterBitmap() ? GL_LINEAR : GL_NEAREST) /////////////////////////////////////////////////////////////////////////////// // Globals Loading libs/hwui/Texture.h +9 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ struct Texture { minFilter = GL_NEAREST; magFilter = GL_NEAREST; mipMap = false; firstFilter = true; firstWrap = true; Loading Loading @@ -83,6 +85,8 @@ struct Texture { glBindTexture(renderTarget, id); } if (mipMap && min == GL_LINEAR) min = GL_LINEAR_MIPMAP_LINEAR; glTexParameteri(renderTarget, GL_TEXTURE_MIN_FILTER, min); glTexParameteri(renderTarget, GL_TEXTURE_MAG_FILTER, mag); } Loading Loading @@ -116,7 +120,12 @@ struct Texture { * Optional, size of the original bitmap. */ uint32_t bitmapSize; /** * Indicates whether this texture will use trilinear filtering. */ bool mipMap; private: /** * Last wrap modes set on this texture. Defaults to GL_CLAMP_TO_EDGE. */ Loading @@ -129,7 +138,6 @@ struct Texture { GLenum minFilter; GLenum magFilter; private: bool firstFilter; bool firstWrap; }; // struct Texture Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -8263,6 +8263,7 @@ package android.graphics { method public int getScaledWidth(int); method public final int getWidth(); method public final boolean hasAlpha(); method public final boolean hasMipMap(); method public final boolean isMutable(); method public final boolean isPremultiplied(); method public final boolean isRecycled(); Loading @@ -8271,6 +8272,7 @@ package android.graphics { method public boolean sameAs(android.graphics.Bitmap); method public void setDensity(int); method public void setHasAlpha(boolean); method public final void setHasMipMap(boolean); method public void setPixel(int, int, int); method public void setPixels(int[], int, int, int, int, int, int); method public void writeToParcel(android.os.Parcel, int);
core/jni/android/graphics/Bitmap.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -353,6 +353,15 @@ static void Bitmap_setHasAlpha(JNIEnv* env, jobject, SkBitmap* bitmap, bitmap->setIsOpaque(!hasAlpha); } static jboolean Bitmap_hasMipMap(JNIEnv* env, jobject, SkBitmap* bitmap) { return bitmap->hasHardwareMipMap(); } static void Bitmap_setHasMipMap(JNIEnv* env, jobject, SkBitmap* bitmap, jboolean hasMipMap) { bitmap->setHasHardwareMipMap(hasMipMap); } /////////////////////////////////////////////////////////////////////////////// static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) { Loading Loading @@ -666,6 +675,8 @@ static JNINativeMethod gBitmapMethods[] = { { "nativeConfig", "(I)I", (void*)Bitmap_config }, { "nativeHasAlpha", "(I)Z", (void*)Bitmap_hasAlpha }, { "nativeSetHasAlpha", "(IZ)V", (void*)Bitmap_setHasAlpha }, { "nativeHasMipMap", "(I)Z", (void*)Bitmap_hasMipMap }, { "nativeSetHasMipMap", "(IZ)V", (void*)Bitmap_setHasMipMap }, { "nativeCreateFromParcel", "(Landroid/os/Parcel;)Landroid/graphics/Bitmap;", (void*)Bitmap_createFromParcel }, Loading
graphics/java/android/graphics/Bitmap.java +48 −1 Original line number Diff line number Diff line Loading @@ -1029,6 +1029,51 @@ public final class Bitmap implements Parcelable { nativeSetHasAlpha(mNativeBitmap, hasAlpha); } /** * Indicates whether the renderer responsible for drawing this * bitmap should attempt to use mipmaps when this bitmap is drawn * scaled down. * * If you know that you are going to draw this bitmap at less than * 50% of its original size, you may be able to obtain a higher * quality * * This property is only a suggestion that can be ignored by the * renderer. It is not guaranteed to have any effect. * * @return true if the renderer should attempt to use mipmaps, * false otherwise * * @see #setHasMipMap(boolean) */ public final boolean hasMipMap() { return nativeHasMipMap(mNativeBitmap); } /** * Set a hint for the renderer responsible for drawing this bitmap * indicating that it should attempt to use mipmaps when this bitmap * is drawn scaled down. * * If you know that you are going to draw this bitmap at less than * 50% of its original size, you may be able to obtain a higher * quality by turning this property on. * * Note that if the renderer respects this hint it might have to * allocate extra memory to hold the mipmap levels for this bitmap. * * This property is only a suggestion that can be ignored by the * renderer. It is not guaranteed to have any effect. * * @param hasMipMap indicates whether the renderer should attempt * to use mipmaps * * @see #hasMipMap() */ public final void setHasMipMap(boolean hasMipMap) { nativeSetHasMipMap(mNativeBitmap, hasMipMap); } /** * Fills the bitmap's pixels with the specified {@link Color}. * Loading Loading @@ -1356,7 +1401,6 @@ public final class Bitmap implements Parcelable { private static native int nativeHeight(int nativeBitmap); private static native int nativeRowBytes(int nativeBitmap); private static native int nativeConfig(int nativeBitmap); private static native boolean nativeHasAlpha(int nativeBitmap); private static native int nativeGetPixel(int nativeBitmap, int x, int y); private static native void nativeGetPixels(int nativeBitmap, int[] pixels, Loading Loading @@ -1385,7 +1429,10 @@ public final class Bitmap implements Parcelable { int[] offsetXY); private static native void nativePrepareToDraw(int nativeBitmap); private static native boolean nativeHasAlpha(int nativeBitmap); private static native void nativeSetHasAlpha(int nBitmap, boolean hasAlpha); private static native boolean nativeHasMipMap(int nativeBitmap); private static native void nativeSetHasMipMap(int nBitmap, boolean hasMipMap); private static native boolean nativeSameAs(int nb0, int nb1); /* package */ final int ni() { Loading
libs/hwui/OpenGLRenderer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ namespace uirenderer { #define ALPHA_THRESHOLD 0 #define FILTER(paint) (paint && paint->isFilterBitmap() ? GL_LINEAR : GL_NEAREST) #define FILTER(paint) (!paint || paint->isFilterBitmap() ? GL_LINEAR : GL_NEAREST) /////////////////////////////////////////////////////////////////////////////// // Globals Loading
libs/hwui/Texture.h +9 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ struct Texture { minFilter = GL_NEAREST; magFilter = GL_NEAREST; mipMap = false; firstFilter = true; firstWrap = true; Loading Loading @@ -83,6 +85,8 @@ struct Texture { glBindTexture(renderTarget, id); } if (mipMap && min == GL_LINEAR) min = GL_LINEAR_MIPMAP_LINEAR; glTexParameteri(renderTarget, GL_TEXTURE_MIN_FILTER, min); glTexParameteri(renderTarget, GL_TEXTURE_MAG_FILTER, mag); } Loading Loading @@ -116,7 +120,12 @@ struct Texture { * Optional, size of the original bitmap. */ uint32_t bitmapSize; /** * Indicates whether this texture will use trilinear filtering. */ bool mipMap; private: /** * Last wrap modes set on this texture. Defaults to GL_CLAMP_TO_EDGE. */ Loading @@ -129,7 +138,6 @@ struct Texture { GLenum minFilter; GLenum magFilter; private: bool firstFilter; bool firstWrap; }; // struct Texture Loading