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

Unified Diff: ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java

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/android/java/src/org/chromium/ui/gfx/BitmapHelper.java
diff --git a/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java b/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java
index 10eb53a3188bfc8700239f1e482b7bd76a375b2e..a936fe77b58f27469be022bd46e1d0df9acceb06 100644
--- a/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java
+++ b/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java
@@ -75,4 +75,26 @@ public class BitmapHelper {
return inSampleSize;
}
+
+ /**
+ * Provides a matching integer constant for the Bitmap.Config value passed.
+ *
+ * @param bitmapConfig The Bitmap Configuration value.
+ * @return Matching integer constant for the Bitmap.Config value passed.
+ */
+ @CalledByNative
+ private static int bitmapConfig(Bitmap.Config bitmapConfig) {
+ switch (bitmapConfig) {
+ case ALPHA_8:
+ return BitmapFormat.FORMAT_ALPHA_8;
+ case ARGB_4444:
+ return BitmapFormat.FORMAT_ARGB_4444;
+ case ARGB_8888:
+ return BitmapFormat.FORMAT_ARGB_8888;
+ case RGB_565:
+ return BitmapFormat.FORMAT_RGB_565;
+ default:
+ return BitmapFormat.FORMAT_NO_CONFIG;
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698