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

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

Issue 157033007: API to Convert Java Bitmap Config to SkBitmap::Config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding webview dependecy build changes. Created 6 years, 10 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 fba158ec7b320ca7fdcbcf2539a677e2c8fcd07f..b7a0f5add151a0fdf52872b6bf6363bb191256f8 100644
--- a/ui/gfx/android/java_bitmap.cc
+++ b/ui/gfx/android/java_bitmap.cc
@@ -10,7 +10,6 @@
#include "base/logging.h"
#include "jni/BitmapHelper_jni.h"
#include "skia/ext/image_operations.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/size.h"
using base::android::AttachCurrentThread;
@@ -102,4 +101,22 @@ SkBitmap CreateSkBitmapFromResource(const char* name, gfx::Size size) {
bitmap, skia::ImageOperations::RESIZE_BOX, size.width(), size.height());
}
+SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config) {
+ int jbitmap_config =
+ Java_BitmapHelper_bitmapConfig(AttachCurrentThread(), bitmap_config);
+ switch (jbitmap_config) {
+ case BITMAP_FORMAT_ALPHA_8:
+ return SkBitmap::kA8_Config;
+ case BITMAP_FORMAT_ARGB_4444:
+ return SkBitmap::kARGB_4444_Config;
+ case BITMAP_FORMAT_ARGB_8888:
+ return SkBitmap::kARGB_8888_Config;
+ case BITMAP_FORMAT_RGB_565:
+ return SkBitmap::kRGB_565_Config;
+ case BITMAP_FORMAT_NO_CONFIG:
+ default:
+ return SkBitmap::kNo_Config;
+ }
+}
+
} // namespace gfx
« content/browser/android/content_view_core_impl.cc ('K') | « ui/gfx/android/java_bitmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698