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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix raster-on-demand codepath Created 7 years, 3 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 83d4a46518203edb5ecafd2efdc7d3b253a32806..d534e0efd5c6995c8dafbf8ef0ada76ab7ca3959 100644
--- a/ui/gfx/android/java_bitmap.cc
+++ b/ui/gfx/android/java_bitmap.cc
@@ -6,6 +6,7 @@
#include <android/bitmap.h>
+#include "base/android/sys_utils.h"
#include "base/logging.h"
#include "jni/BitmapHelper_jni.h"
#include "skia/ext/image_operations.h"
@@ -91,6 +92,12 @@ static SkBitmap ConvertToSkBitmap(ScopedJavaLocalRef<jobject> jbitmap) {
memcpy(dst_pixels, src_pixels, skbitmap.getSize());
+ if (base::android::SysUtils::IsLowEndDevice()) {
Sami 2013/09/05 14:13:26 Is this mainly for UI resources? You could conside
kaanb 2013/09/06 02:05:54 Done.
+ SkBitmap bitmap_16;
+ skbitmap.copyTo(&bitmap_16, SkBitmap::kARGB_4444_Config);
+ return bitmap_16;
+ }
+
return skbitmap;
}

Powered by Google App Engine
This is Rietveld 408576698