Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: ui/gfx/android/java_bitmap.cc

Issue 335943002: [Android] Composited selection handle rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_native_handles_final
Patch Set: Clean up paste popup interaction Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}

Powered by Google App Engine
This is Rietveld 408576698