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 "skia/ext/bitmap_platform_device_android.h" | 5 #include "skia/ext/bitmap_platform_device_skia.h" |
6 #include "skia/ext/platform_canvas.h" | 6 #include "skia/ext/platform_canvas.h" |
7 | 7 |
8 namespace skia { | 8 namespace skia { |
9 | 9 |
10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, | 10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
11 bool is_opaque) { | 11 bool is_opaque) { |
12 SkBitmap bitmap; | 12 SkBitmap bitmap; |
13 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, | 13 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, |
14 is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); | 14 is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); |
15 if (bitmap.allocPixels()) { | 15 if (bitmap.allocPixels()) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, | 90 bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, |
91 is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); | 91 is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); |
92 if (!bitmap_.allocPixels()) | 92 if (!bitmap_.allocPixels()) |
93 return false; | 93 return false; |
94 | 94 |
95 surface_ = bitmap_.getPixels(); | 95 surface_ = bitmap_.getPixels(); |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 } // namespace skia | 99 } // namespace skia |
OLD | NEW |