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

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

Issue 10823094: Add bitmap utils for Chrome on Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Include fixes from downstream 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
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_BITMAP_ANDROID_H_
6 #define UI_GFX_BITMAP_ANDROID_H_
7
8 #include "base/android/scoped_java_ref.h"
9 #include "ui/gfx/size.h"
10
11 class SkBitmap;
12
13 using base::android::ScopedJavaLocalRef;
sky 2012/08/03 17:15:36 No using in headers.
Jesse Greenwald 2012/08/03 20:10:06 Done.
14
15 namespace gfx {
16
17 class AutoLockJavaBitmap {
nilesh 2012/08/03 04:52:36 Please add a class level comment.
sky 2012/08/03 17:15:36 Do you need to export this class?
sky 2012/08/03 17:15:36 Filename should match class name.
Jesse Greenwald 2012/08/03 20:10:06 Done.
18 public:
19 AutoLockJavaBitmap(jobject bitmap);
sky 2012/08/03 17:15:36 explicit
Jesse Greenwald 2012/08/03 20:10:06 Done.
20 ~AutoLockJavaBitmap();
21
22 void* pixels() const { return pixels_; }
sky 2012/08/03 17:15:36 Generally its bad practice to return a non-const p
Jesse Greenwald 2012/08/03 20:10:06 Done - change it so that it's not a const function
23 gfx::Size size() const;
sky 2012/08/03 17:15:36 unix_hacker_style function names are intended for
Jesse Greenwald 2012/08/03 20:10:06 Done.
24 // Formats are in android/bitmap.h; e.g. ANDROID_BITMAP_FORMAT_RGBA_8888
25 int format() const;
26 uint32_t stride() const;
27
28 private:
29 jobject bitmap_;
30 void* pixels_;
31
32 DISALLOW_COPY_AND_ASSIGN(AutoLockJavaBitmap);
33 };
34
35 base::android::ScopedJavaLocalRef<jobject> CreateJavaBitmap(
36 const gfx::Size& size);
37
38 ScopedJavaLocalRef<jobject> ConvertToJavaBitmap(const SkBitmap* skbitmap);
39
40 } // namespace gfx
41
42 #endif // UI_GFX_BITMAP_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698