OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef SKIA_EXT_PLATFORM_CANVAS_H_ | 5 #ifndef SKIA_EXT_PLATFORM_CANVAS_H_ |
6 #define SKIA_EXT_PLATFORM_CANVAS_H_ | 6 #define SKIA_EXT_PLATFORM_CANVAS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // The platform-specific device will include the necessary platform headers | 9 // The platform-specific device will include the necessary platform headers |
10 // to get the surface type. | 10 // to get the surface type. |
11 #include "skia/ext/platform_device.h" | 11 #include "skia/ext/platform_device.h" |
12 #include "third_party/skia/include/core/SkCanvas.h" | 12 #include "third_party/skia/include/core/SkCanvas.h" |
13 | 13 |
14 namespace skia { | 14 namespace skia { |
15 | 15 |
16 // This class is a specialization of the regular SkCanvas that is designed to | 16 // This class is a specialization of the regular SkCanvas that is designed to |
17 // work with a PlatformDevice to manage platform-specific drawing. It allows | 17 // work with a PlatformDevice to manage platform-specific drawing. It allows |
18 // using both Skia operations and platform-specific operations. | 18 // using both Skia operations and platform-specific operations. |
19 class PlatformCanvas : public SkCanvas { | 19 class SK_API PlatformCanvas : public SkCanvas { |
20 public: | 20 public: |
21 // If you use the version with no arguments, you MUST call initialize() | 21 // If you use the version with no arguments, you MUST call initialize() |
22 PlatformCanvas(); | 22 PlatformCanvas(); |
23 explicit PlatformCanvas(SkDeviceFactory* factory); | 23 explicit PlatformCanvas(SkDeviceFactory* factory); |
24 // Set is_opaque if you are going to erase the bitmap and not use | 24 // Set is_opaque if you are going to erase the bitmap and not use |
25 // transparency: this will enable some optimizations. | 25 // transparency: this will enable some optimizations. |
26 PlatformCanvas(int width, int height, bool is_opaque); | 26 PlatformCanvas(int width, int height, bool is_opaque); |
27 | 27 |
28 #if defined(WIN32) | 28 #if defined(WIN32) |
29 // The shared_section parameter is passed to gfx::PlatformDevice::create. | 29 // The shared_section parameter is passed to gfx::PlatformDevice::create. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 virtual SkDevice* setBitmapDevice(const SkBitmap& bitmap); | 110 virtual SkDevice* setBitmapDevice(const SkBitmap& bitmap); |
111 | 111 |
112 // Disallow copy and assign. | 112 // Disallow copy and assign. |
113 PlatformCanvas(const PlatformCanvas&); | 113 PlatformCanvas(const PlatformCanvas&); |
114 PlatformCanvas& operator=(const PlatformCanvas&); | 114 PlatformCanvas& operator=(const PlatformCanvas&); |
115 }; | 115 }; |
116 | 116 |
117 } // namespace skia | 117 } // namespace skia |
118 | 118 |
119 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 119 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
OLD | NEW |