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 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ |
6 #define SKIA_EXT_PLATFORM_DEVICE_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 64 |
65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
66 // Initializes the default settings and colors in a device context. | 66 // Initializes the default settings and colors in a device context. |
67 SK_API void InitializeDC(HDC context); | 67 SK_API void InitializeDC(HDC context); |
68 #elif defined(OS_MACOSX) | 68 #elif defined(OS_MACOSX) |
69 // Returns the CGContext that backing the SkBaseDevice. Forwards to the bound | 69 // Returns the CGContext that backing the SkBaseDevice. Forwards to the bound |
70 // PlatformDevice. Returns NULL if no PlatformDevice is bound. | 70 // PlatformDevice. Returns NULL if no PlatformDevice is bound. |
71 SK_API CGContextRef GetBitmapContext(SkBaseDevice* device); | 71 SK_API CGContextRef GetBitmapContext(SkBaseDevice* device); |
72 #endif | 72 #endif |
73 | 73 |
74 // Following routines are used in print preview workflow to mark the draft mode | 74 // Following routines are used in print preview workflow to mark the draft mode |
Lei Zhang
2015/11/18 20:19:35
comment needs updating
| |
75 // metafile and preview metafile. | 75 // metafile and preview metafile. |
76 SK_API SkMetaData& getMetaData(const SkCanvas& canvas); | 76 SK_API SkMetaData& getMetaData(const SkCanvas& canvas); |
77 SK_API void SetIsDraftMode(const SkCanvas& canvas, bool draft_mode); | |
78 SK_API bool IsDraftMode(const SkCanvas& canvas); | |
79 | 77 |
80 #if defined(OS_MACOSX) || defined(OS_WIN) | 78 #if defined(OS_MACOSX) |
81 SK_API void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview); | 79 SK_API void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview); |
82 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); | 80 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); |
83 #endif | 81 #endif |
84 | 82 |
85 // A SkBitmapDevice is basically a wrapper around SkBitmap that provides a | 83 // A SkBitmapDevice is basically a wrapper around SkBitmap that provides a |
86 // surface for SkCanvas to draw into. PlatformDevice provides a surface | 84 // surface for SkCanvas to draw into. PlatformDevice provides a surface |
87 // Windows can also write to. It also provides functionality to play well | 85 // Windows can also write to. It also provides functionality to play well |
88 // with GDI drawing functions. This class is abstract and must be subclassed. | 86 // with GDI drawing functions. This class is abstract and must be subclassed. |
89 // It provides the basic interface to implement it either with or without | 87 // It provides the basic interface to implement it either with or without |
90 // a bitmap backend. | 88 // a bitmap backend. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix); | 145 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix); |
148 | 146 |
149 // Transforms SkPath's paths into a series of cubic path. | 147 // Transforms SkPath's paths into a series of cubic path. |
150 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); | 148 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); |
151 #endif | 149 #endif |
152 }; | 150 }; |
153 | 151 |
154 } // namespace skia | 152 } // namespace skia |
155 | 153 |
156 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 154 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
OLD | NEW |