OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_ANDROID_JAVA_BITMAP_H_ | 5 #ifndef UI_GFX_ANDROID_JAVA_BITMAP_H_ |
6 #define UI_GFX_ANDROID_JAVA_BITMAP_H_ | 6 #define UI_GFX_ANDROID_JAVA_BITMAP_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 | 15 |
16 // A Java counterpart will be generated for this enum. | 16 // A Java counterpart will be generated for this enum. |
17 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.gfx | 17 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.gfx |
18 enum BitmapFormat { | 18 enum BitmapFormat { |
19 BITMAP_FORMAT_NO_CONFIG, | 19 BITMAP_FORMAT_NO_CONFIG, |
20 BITMAP_FORMAT_ALPHA_8, | 20 BITMAP_FORMAT_ALPHA_8, |
21 BITMAP_FORMAT_ARGB_4444, | 21 BITMAP_FORMAT_ARGB_4444, |
22 BITMAP_FORMAT_ARGB_8888, | 22 BITMAP_FORMAT_ARGB_8888, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Converts |bitmap| to an SkBitmap of the same size and format. | 67 // Converts |bitmap| to an SkBitmap of the same size and format. |
68 // Note: |jbitmap| is assumed to be non-null, non-empty and of format RGBA_8888. | 68 // Note: |jbitmap| is assumed to be non-null, non-empty and of format RGBA_8888. |
69 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap); | 69 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap); |
70 | 70 |
71 // Returns a Skia color type value for the requested input java Bitmap.Config. | 71 // Returns a Skia color type value for the requested input java Bitmap.Config. |
72 GFX_EXPORT SkColorType ConvertToSkiaColorType(jobject jbitmap_config); | 72 GFX_EXPORT SkColorType ConvertToSkiaColorType(jobject jbitmap_config); |
73 | 73 |
74 } // namespace gfx | 74 } // namespace gfx |
75 | 75 |
76 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ | 76 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ |
OLD | NEW |