| 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 SK_API 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 // 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 |
| 24 // transparency: this will enable some optimizations. | 25 // transparency: this will enable some optimizations. |
| 25 PlatformCanvas(int width, int height, bool is_opaque); | 26 PlatformCanvas(int width, int height, bool is_opaque); |
| 26 | 27 |
| 27 #if defined(WIN32) | 28 #if defined(WIN32) |
| 28 // The shared_section parameter is passed to gfx::PlatformDevice::create. | 29 // The shared_section parameter is passed to gfx::PlatformDevice::create. |
| 29 // See it for details. | 30 // See it for details. |
| 30 PlatformCanvas(int width, int height, bool is_opaque, HANDLE shared_section); | 31 PlatformCanvas(int width, int height, bool is_opaque, HANDLE shared_section); |
| 31 #elif defined(__APPLE__) | 32 #elif defined(__APPLE__) |
| 32 PlatformCanvas(int width, int height, bool is_opaque, | 33 PlatformCanvas(int width, int height, bool is_opaque, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 PlatformSurface platform_surface_; | 150 PlatformSurface platform_surface_; |
| 150 | 151 |
| 151 // Disallow copy and assign | 152 // Disallow copy and assign |
| 152 ScopedPlatformPaint(const ScopedPlatformPaint&); | 153 ScopedPlatformPaint(const ScopedPlatformPaint&); |
| 153 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&); | 154 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 } // namespace skia | 157 } // namespace skia |
| 157 | 158 |
| 158 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 159 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
| OLD | NEW |