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

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

Issue 10823094: Add bitmap utils for Chrome on Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address review comments Created 8 years, 4 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 | « ui/gfx/android/gfx_jni_registrar.cc ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_ANDROID_JAVA_BITMAP_H_
6 #define UI_GFX_ANDROID_JAVA_BITMAP_H_
7
8 #include "base/android/scoped_java_ref.h"
9 #include "ui/gfx/size.h"
10
11 class SkBitmap;
12
13 namespace gfx {
14
15 // This class wraps a JNI AndroidBitmap object to make it easier to use. It
16 // handles locking and unlocking of the underlying pixels, along with wrapping
17 // various JNI methods.
18 UI_EXPORT class JavaBitmap {
19 public:
20 explicit JavaBitmap(jobject bitmap);
21 ~JavaBitmap();
22
23 void* pixels() { return pixels_; }
24 gfx::Size Size() const;
25 // Formats are in android/bitmap.h; e.g. ANDROID_BITMAP_FORMAT_RGBA_8888
26 int Format() const;
27 uint32_t Stride() const;
28
29 private:
30 jobject bitmap_;
31 void* pixels_;
32
33 DISALLOW_COPY_AND_ASSIGN(JavaBitmap);
34 };
35
36 base::android::ScopedJavaLocalRef<jobject> CreateJavaBitmap(
37 const gfx::Size& size);
38
39 base::android::ScopedJavaLocalRef<jobject> ConvertToJavaBitmap(
40 const SkBitmap* skbitmap);
41
42 } // namespace gfx
43
44 #endif // UI_GFX_ANDROID_JAVA_BITMAP_H_
OLDNEW
« no previous file with comments | « ui/gfx/android/gfx_jni_registrar.cc ('k') | ui/gfx/android/java_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698