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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 private: | 42 private: |
43 jobject bitmap_; | 43 jobject bitmap_; |
44 void* pixels_; | 44 void* pixels_; |
45 gfx::Size size_; | 45 gfx::Size size_; |
46 int format_; | 46 int format_; |
47 uint32_t stride_; | 47 uint32_t stride_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(JavaBitmap); | 49 DISALLOW_COPY_AND_ASSIGN(JavaBitmap); |
50 }; | 50 }; |
51 | 51 |
52 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> CreateJavaBitmap( | |
jdduke (slow)
2014/03/06 01:18:19
While it may seem self-explanatory, please put a s
| |
53 int width, | |
54 int height, | |
55 SkBitmap::Config bitmap_config); | |
56 | |
52 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap( | 57 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap( |
53 const SkBitmap* skbitmap); | 58 const SkBitmap* skbitmap); |
54 | 59 |
55 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(JavaBitmap& jbitmap); | 60 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(JavaBitmap& jbitmap); |
56 | 61 |
57 // If the resource loads successfully, it will be resized to |size|. | 62 // If the resource loads successfully, it will be resized to |size|. |
58 // Note: If the source resource is smaller than |size|, quality may suffer. | 63 // Note: If the source resource is smaller than |size|, quality may suffer. |
59 GFX_EXPORT SkBitmap CreateSkBitmapFromResource(const char* name, | 64 GFX_EXPORT SkBitmap CreateSkBitmapFromResource(const char* name, |
60 gfx::Size size); | 65 gfx::Size size); |
61 | 66 |
62 // Returns a Skia config value for the requested input java Bitmap.Config. | 67 // Returns a Skia config value for the requested input java Bitmap.Config. |
63 GFX_EXPORT SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config); | 68 GFX_EXPORT SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config); |
64 | 69 |
65 } // namespace gfx | 70 } // namespace gfx |
66 | 71 |
67 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ | 72 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ |
OLD | NEW |