| 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 #ifndef SKIA_EXT_PLATFORM_DEVICE_WIN_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_WIN_H_ |
| 6 #define SKIA_EXT_PLATFORM_DEVICE_WIN_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "SkDevice.h" | 13 #include "third_party/skia/include/core/SkDevice.h" |
| 14 | 14 |
| 15 class SkMatrix; | 15 class SkMatrix; |
| 16 class SkPath; | 16 class SkPath; |
| 17 class SkRegion; | 17 class SkRegion; |
| 18 | 18 |
| 19 namespace skia { | 19 namespace skia { |
| 20 | 20 |
| 21 // A device is basically a wrapper around SkBitmap that provides a surface for | 21 // A device is basically a wrapper around SkBitmap that provides a surface for |
| 22 // SkCanvas to draw into. Our device provides a surface Windows can also write | 22 // SkCanvas to draw into. Our device provides a surface Windows can also write |
| 23 // to. It also provides functionality to play well with GDI drawing functions. | 23 // to. It also provides functionality to play well with GDI drawing functions. |
| 24 // This class is abstract and must be subclassed. It provides the basic | 24 // This class is abstract and must be subclassed. It provides the basic |
| 25 // interface to implement it either with or without a bitmap backend. | 25 // interface to implement it either with or without a bitmap backend. |
| 26 class PlatformDevice : public SkDevice { | 26 class SK_API PlatformDevice : public SkDevice { |
| 27 public: | 27 public: |
| 28 typedef HDC PlatformSurface; | 28 typedef HDC PlatformSurface; |
| 29 | 29 |
| 30 // The DC that corresponds to the bitmap, used for GDI operations drawing | 30 // The DC that corresponds to the bitmap, used for GDI operations drawing |
| 31 // into the bitmap. This is possibly heavyweight, so it should be existant | 31 // into the bitmap. This is possibly heavyweight, so it should be existant |
| 32 // only during one pass of rendering. | 32 // only during one pass of rendering. |
| 33 virtual HDC getBitmapDC() = 0; | 33 virtual HDC getBitmapDC() = 0; |
| 34 | 34 |
| 35 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will | 35 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will |
| 36 // temporarily create it. However, if you have created the bitmap DC, it will | 36 // temporarily create it. However, if you have created the bitmap DC, it will |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix); | 75 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix); |
| 76 | 76 |
| 77 // Transforms SkPath's paths into a series of cubic path. | 77 // Transforms SkPath's paths into a series of cubic path. |
| 78 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); | 78 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace skia | 81 } // namespace skia |
| 82 | 82 |
| 83 #endif // SKIA_EXT_PLATFORM_DEVICE_WIN_H_ | 83 #endif // SKIA_EXT_PLATFORM_DEVICE_WIN_H_ |
| 84 | 84 |
| OLD | NEW |