* commit '99c070d8eb9f1ff9ea5c38991f15f091040226c2': Add WEBP to the list of Image formats that support Compression.
This commit is contained in:
committed by
Android Git Automerger
commit
ec5039b372
@ -271,7 +271,8 @@ static void Bitmap_recycle(JNIEnv* env, jobject, SkBitmap* bitmap) {
|
|||||||
// These must match the int values in Bitmap.java
|
// These must match the int values in Bitmap.java
|
||||||
enum JavaEncodeFormat {
|
enum JavaEncodeFormat {
|
||||||
kJPEG_JavaEncodeFormat = 0,
|
kJPEG_JavaEncodeFormat = 0,
|
||||||
kPNG_JavaEncodeFormat = 1
|
kPNG_JavaEncodeFormat = 1,
|
||||||
|
kWEBP_JavaEncodeFormat = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap,
|
static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap,
|
||||||
@ -286,6 +287,9 @@ static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap,
|
|||||||
case kPNG_JavaEncodeFormat:
|
case kPNG_JavaEncodeFormat:
|
||||||
fm = SkImageEncoder::kPNG_Type;
|
fm = SkImageEncoder::kPNG_Type;
|
||||||
break;
|
break;
|
||||||
|
case kWEBP_JavaEncodeFormat:
|
||||||
|
fm = SkImageEncoder::kWEBP_Type;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -681,7 +681,8 @@ public final class Bitmap implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public enum CompressFormat {
|
public enum CompressFormat {
|
||||||
JPEG (0),
|
JPEG (0),
|
||||||
PNG (1);
|
PNG (1),
|
||||||
|
WEBP (2);
|
||||||
|
|
||||||
CompressFormat(int nativeInt) {
|
CompressFormat(int nativeInt) {
|
||||||
this.nativeInt = nativeInt;
|
this.nativeInt = nativeInt;
|
||||||
|
Reference in New Issue
Block a user