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

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

Issue 157033007: API to Convert Java Bitmap Config to SkBitmap::Config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change function signature and Cleanup 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
« no previous file with comments | « ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java ('k') | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/android/java_bitmap.h
diff --git a/ui/gfx/android/java_bitmap.h b/ui/gfx/android/java_bitmap.h
index 9d1e4432cb7dcafaed425e7b20159b82875f3b31..47140a35d83b77c8462d952800a1fdf0818f84d0 100644
--- a/ui/gfx/android/java_bitmap.h
+++ b/ui/gfx/android/java_bitmap.h
@@ -8,10 +8,9 @@
#include <jni.h>
#include "base/android/scoped_java_ref.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/size.h"
-class SkBitmap;
-
namespace gfx {
// This class wraps a JNI AndroidBitmap object to make it easier to use. It
@@ -19,6 +18,14 @@ namespace gfx {
// various JNI methods.
class GFX_EXPORT JavaBitmap {
public:
+ typedef enum {
no sievers 2014/02/14 18:39:57 nit: use anonymous enum (no typedef) enum { };
sivag 2014/02/17 07:09:50 Done.
+ BITMAP_CONFIG_NO_CONFIG = 0,
+ BITMAP_CONFIG_ALPHA_8,
+ BITMAP_CONFIG_ARGB_4444,
+ BITMAP_CONFIG_ARGB_8888,
+ BITMAP_CONFIG_RGB_565
+ } Config;
+
explicit JavaBitmap(jobject bitmap);
~JavaBitmap();
@@ -51,6 +58,9 @@ GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(JavaBitmap& jbitmap);
GFX_EXPORT SkBitmap CreateSkBitmapFromResource(const char* name,
gfx::Size size);
+// Returns a Skia config value for the requested input java Bitmap.Config.
+GFX_EXPORT SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config);
+
} // namespace gfx
#endif // UI_GFX_ANDROID_JAVA_BITMAP_H_
« no previous file with comments | « ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java ('k') | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698