diff options
author | Vikas Arora <vikasa@google.com> | 2011-06-23 13:11:13 +0530 |
---|---|---|
committer | Vikas Arora <vikasa@google.com> | 2011-06-23 13:11:13 +0530 |
commit | 2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb (patch) | |
tree | a195b25c26752b23052b6e78691fc93e09f0eab6 /core/jni | |
parent | e2b41b0d5c8db85a60cd190c7094052db61114b2 (diff) | |
download | frameworks_base-2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb.zip frameworks_base-2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb.tar.gz frameworks_base-2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb.tar.bz2 |
Add WEBP to the list of Image formats that support Compression.
Note: The integrator of this change to Android internal code-repo will
have to run one extra step 'make update-api' to update 'api/current.txt'
file corresponding to approved API. The AOSP branch didn't have this
file, hence I could not add the same to this change. The updated file
'api/current.txt' has to be submitted along with this change.
Change-Id: I29909e907a2e82d801e16654322190a808c5bda9
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android/graphics/Bitmap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp index 083e3b1..56f1ebf 100644 --- a/core/jni/android/graphics/Bitmap.cpp +++ b/core/jni/android/graphics/Bitmap.cpp @@ -261,7 +261,8 @@ static void Bitmap_recycle(JNIEnv* env, jobject, SkBitmap* bitmap) { // These must match the int values in Bitmap.java
enum JavaEncodeFormat {
kJPEG_JavaEncodeFormat = 0,
- kPNG_JavaEncodeFormat = 1
+ kPNG_JavaEncodeFormat = 1,
+ kWEBP_JavaEncodeFormat = 2
};
static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap,
@@ -276,6 +277,9 @@ static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap, case kPNG_JavaEncodeFormat:
fm = SkImageEncoder::kPNG_Type;
break;
+ case kWEBP_JavaEncodeFormat:
+ fm = SkImageEncoder::kWEBP_Type;
+ break;
default:
return false;
}
@@ -626,4 +630,3 @@ int register_android_graphics_Bitmap(JNIEnv* env) return android::AndroidRuntime::registerNativeMethods(env, kClassPathName,
gBitmapMethods, SK_ARRAY_COUNT(gBitmapMethods));
}
-
|