Index: ui/gfx/android/java_bitmap.cc |
diff --git a/ui/gfx/android/java_bitmap.cc b/ui/gfx/android/java_bitmap.cc |
index 7512b4222b1a103c29bcb65ddc0eb42932d4b860..6e974c1d3eacb3dddf5a3d5b8486d130a8c442ac 100644 |
--- a/ui/gfx/android/java_bitmap.cc |
+++ b/ui/gfx/android/java_bitmap.cc |
@@ -69,13 +69,27 @@ ScopedJavaLocalRef<jobject> CreateJavaBitmap(int width, |
} |
ScopedJavaLocalRef<jobject> CreateJavaBitmapFromAndroidResource( |
+ int resource_id) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ return Java_BitmapHelper_decodeDrawableResourceAGB_I(env, resource_id); |
+} |
+ |
+ScopedJavaLocalRef<jobject> CreateJavaBitmapFromAndroidResource( |
+ const char* name) { |
+ DCHECK(name); |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jstring> jname(ConvertUTF8ToJavaString(env, name)); |
+ return Java_BitmapHelper_decodeDrawableResourceAGB_JLS(env, jname.obj()); |
+} |
+ |
+ScopedJavaLocalRef<jobject> CreateJavaBitmapFromAndroidResource( |
const char* name, |
gfx::Size size) { |
DCHECK(name); |
DCHECK(!size.IsEmpty()); |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jstring> jname(ConvertUTF8ToJavaString(env, name)); |
- return Java_BitmapHelper_decodeDrawableResource( |
+ return Java_BitmapHelper_decodeAndDownsampleDrawableResource( |
env, jname.obj(), size.width(), size.height()); |
} |