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

Side by Side Diff: ui/gfx/android/java_bitmap.h

Issue 183023002: [Android] Modify CreateJavaBitmap to accept SkBitmap::Config and export the API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Allocates a Java-backed bitmap (android.graphics.Bitmap) with the given size
53 // and configuration.
54 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> CreateJavaBitmap(
55 int width,
56 int height,
57 SkBitmap::Config bitmap_config);
58
52 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap( 59 GFX_EXPORT base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap(
53 const SkBitmap* skbitmap); 60 const SkBitmap* skbitmap);
54 61
55 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(JavaBitmap& jbitmap); 62 GFX_EXPORT SkBitmap CreateSkBitmapFromJavaBitmap(JavaBitmap& jbitmap);
56 63
57 // If the resource loads successfully, it will be resized to |size|. 64 // If the resource loads successfully, it will be resized to |size|.
58 // Note: If the source resource is smaller than |size|, quality may suffer. 65 // Note: If the source resource is smaller than |size|, quality may suffer.
59 GFX_EXPORT SkBitmap CreateSkBitmapFromResource(const char* name, 66 GFX_EXPORT SkBitmap CreateSkBitmapFromResource(const char* name,
60 gfx::Size size); 67 gfx::Size size);
61 68
62 // Returns a Skia config value for the requested input java Bitmap.Config. 69 // Returns a Skia config value for the requested input java Bitmap.Config.
63 GFX_EXPORT SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config); 70 GFX_EXPORT SkBitmap::Config ConvertToSkiaConfig(jobject bitmap_config);
64 71
65 } // namespace gfx 72 } // namespace gfx
66 73
67 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_ 74 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698