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 #include "ui/gfx/android/java_bitmap.h" | 5 #include "ui/gfx/android/java_bitmap.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "jni/BitmapHelper_jni.h" | 11 #include "jni/BitmapHelper_jni.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 | 13 |
14 using base::android::AttachCurrentThread; | 14 using base::android::AttachCurrentThread; |
15 using base::android::ConvertUTF8ToJavaString; | 15 using base::android::ConvertUTF8ToJavaString; |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 | 18 |
19 JavaBitmap::JavaBitmap(jobject bitmap) | 19 JavaBitmap::JavaBitmap(jobject bitmap) |
20 : bitmap_(bitmap), | 20 : bitmap_(bitmap), |
21 pixels_(NULL) { | 21 pixels_(NULL) { |
22 int err = AndroidBitmap_lockPixels(AttachCurrentThread(), bitmap_, &pixels_); | 22 int err = AndroidBitmap_lockPixels(AttachCurrentThread(), bitmap_, &pixels_); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return kN32_SkColorType; | 127 return kN32_SkColorType; |
128 case BITMAP_FORMAT_RGB_565: | 128 case BITMAP_FORMAT_RGB_565: |
129 return kRGB_565_SkColorType; | 129 return kRGB_565_SkColorType; |
130 case BITMAP_FORMAT_NO_CONFIG: | 130 case BITMAP_FORMAT_NO_CONFIG: |
131 default: | 131 default: |
132 return kUnknown_SkColorType; | 132 return kUnknown_SkColorType; |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 } // namespace gfx | 136 } // namespace gfx |
OLD | NEW |