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_DEVICE_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ |
6 #define SKIA_EXT_PLATFORM_DEVICE_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // A SkDevice is basically a wrapper around SkBitmap that provides a surface for | 91 // A SkDevice is basically a wrapper around SkBitmap that provides a surface for |
92 // SkCanvas to draw into. PlatformDevice provides a surface Windows can also | 92 // SkCanvas to draw into. PlatformDevice provides a surface Windows can also |
93 // write to. It also provides functionality to play well with GDI drawing | 93 // write to. It also provides functionality to play well with GDI drawing |
94 // functions. This class is abstract and must be subclassed. It provides the | 94 // functions. This class is abstract and must be subclassed. It provides the |
95 // basic interface to implement it either with or without a bitmap backend. | 95 // basic interface to implement it either with or without a bitmap backend. |
96 // | 96 // |
97 // PlatformDevice provides an interface which sub-classes of SkDevice can also | 97 // PlatformDevice provides an interface which sub-classes of SkDevice can also |
98 // provide to allow for drawing by the native platform into the device. | 98 // provide to allow for drawing by the native platform into the device. |
99 class SK_API PlatformDevice { | 99 class SK_API PlatformDevice { |
100 public: | 100 public: |
| 101 enum PlatformDeviceFlags { |
| 102 FLAGS_NONE = 0, |
| 103 FLAGS_OPAQUE = 1, |
| 104 FLAGS_INITIALIZED = 2 |
| 105 }; |
| 106 static int GetDefaultFlags(bool is_opaque); |
| 107 |
101 virtual ~PlatformDevice() {} | 108 virtual ~PlatformDevice() {} |
102 | 109 |
103 #if defined(OS_MACOSX) | 110 #if defined(OS_MACOSX) |
104 // The CGContext that corresponds to the bitmap, used for CoreGraphics | 111 // The CGContext that corresponds to the bitmap, used for CoreGraphics |
105 // operations drawing into the bitmap. This is possibly heavyweight, so it | 112 // operations drawing into the bitmap. This is possibly heavyweight, so it |
106 // should exist only during one pass of rendering. | 113 // should exist only during one pass of rendering. |
107 virtual CGContextRef GetBitmapContext() = 0; | 114 virtual CGContextRef GetBitmapContext() = 0; |
108 #endif | 115 #endif |
109 | 116 |
110 // The DC that corresponds to the bitmap, used for GDI operations drawing | 117 // The DC that corresponds to the bitmap, used for GDI operations drawing |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #elif defined(OS_MACOSX) | 178 #elif defined(OS_MACOSX) |
172 // Loads the specified Skia transform into the device context | 179 // Loads the specified Skia transform into the device context |
173 static void LoadTransformToCGContext(CGContextRef context, | 180 static void LoadTransformToCGContext(CGContextRef context, |
174 const SkMatrix& matrix); | 181 const SkMatrix& matrix); |
175 #endif | 182 #endif |
176 }; | 183 }; |
177 | 184 |
178 } // namespace skia | 185 } // namespace skia |
179 | 186 |
180 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 187 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
OLD | NEW |