OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/platform_canvas_linux.h" | 5 #include "skia/ext/platform_canvas_linux.h" |
6 | 6 |
7 #include "skia/ext/platform_device_linux.h" | 7 #include "skia/ext/platform_device_linux.h" |
8 #include "skia/ext/bitmap_platform_device_linux.h" | 8 #include "skia/ext/bitmap_platform_device_linux.h" |
9 #include "SkTypes.h" | 9 #include "SkTypes.h" |
10 | 10 |
| 11 #include <cairo/cairo.h> |
| 12 |
11 namespace skia { | 13 namespace skia { |
12 | 14 |
13 PlatformCanvasLinux::PlatformCanvasLinux() : SkCanvas() { | 15 PlatformCanvasLinux::PlatformCanvasLinux() : SkCanvas() { |
14 } | 16 } |
15 | 17 |
16 PlatformCanvasLinux::PlatformCanvasLinux(int width, int height, bool is_opaque) | 18 PlatformCanvasLinux::PlatformCanvasLinux(int width, int height, bool is_opaque) |
17 : SkCanvas() { | 19 : SkCanvas() { |
18 if (!initialize(width, height, is_opaque)) | 20 if (!initialize(width, height, is_opaque)) |
19 SK_CRASH(); | 21 SK_CRASH(); |
20 } | 22 } |
(...skipping 24 matching lines...) Expand all Loading... |
45 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 47 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
46 return createPlatformDevice(width, height, is_opaque); | 48 return createPlatformDevice(width, height, is_opaque); |
47 } | 49 } |
48 | 50 |
49 SkDevice* PlatformCanvasLinux::createPlatformDevice(int width, | 51 SkDevice* PlatformCanvasLinux::createPlatformDevice(int width, |
50 int height, | 52 int height, |
51 bool is_opaque) { | 53 bool is_opaque) { |
52 return BitmapPlatformDeviceLinux::Create(width, height, is_opaque); | 54 return BitmapPlatformDeviceLinux::Create(width, height, is_opaque); |
53 } | 55 } |
54 | 56 |
| 57 // static |
| 58 size_t PlatformCanvasLinux::StrideForWidth(unsigned width) { |
| 59 return cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); |
| 60 } |
| 61 |
55 } // namespace skia | 62 } // namespace skia |
OLD | NEW |