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 #include <stdint.h> |
9 | 10 |
10 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/macros.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
13 | 15 |
14 namespace gfx { | 16 namespace gfx { |
15 | 17 |
16 // A Java counterpart will be generated for this enum. | 18 // A Java counterpart will be generated for this enum. |
17 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.gfx | 19 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.gfx |
18 enum BitmapFormat { | 20 enum BitmapFormat { |
19 BITMAP_FORMAT_NO_CONFIG, | 21 BITMAP_FORMAT_NO_CONFIG, |
20 BITMAP_FORMAT_ALPHA_8, | 22 BITMAP_FORMAT_ALPHA_8, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Converts |bitmap| to an SkBitmap of the same size and format. | 71 // Converts |bitmap| to an SkBitmap of the same size and format. |
70 // Note: |jbitmap| is assumed to be non-null, non-empty and of format RGBA_8888. | 72 // Note: |jbitmap| is assumed to be non-null, non-empty and of format RGBA_8888. |
71 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap); | 73 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap); |
72 | 74 |
73 // Returns a Skia color type value for the requested input java Bitmap.Config. | 75 // Returns a Skia color type value for the requested input java Bitmap.Config. |
74 GFX_EXPORT SkColorType ConvertToSkiaColorType(jobject jbitmap_config); | 76 GFX_EXPORT SkColorType ConvertToSkiaColorType(jobject jbitmap_config); |
75 | 77 |
76 } // namespace gfx | 78 } // namespace gfx |
77 | 79 |
78 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ | 80 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ |
OLD | NEW |