| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // temporarily create it. However, if you have created the bitmap DC, it will | 117 // temporarily create it. However, if you have created the bitmap DC, it will |
| 118 // be more efficient if you don't free it until after this call so it doesn't | 118 // be more efficient if you don't free it until after this call so it doesn't |
| 119 // have to be created twice. If src_rect is null, then the entirety of the | 119 // have to be created twice. If src_rect is null, then the entirety of the |
| 120 // source device will be copied. | 120 // source device will be copied. |
| 121 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y, | 121 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y, |
| 122 const PlatformRect* src_rect) = 0; | 122 const PlatformRect* src_rect) = 0; |
| 123 | 123 |
| 124 // Returns if GDI is allowed to render text to this device. | 124 // Returns if GDI is allowed to render text to this device. |
| 125 virtual bool IsNativeFontRenderingAllowed(); | 125 virtual bool IsNativeFontRenderingAllowed(); |
| 126 | 126 |
| 127 // True if AlphaBlend() was called during a | |
| 128 // BeginPlatformPaint()/EndPlatformPaint() pair. | |
| 129 // Used by the printing subclasses. See |VectorPlatformDeviceEmf|. | |
| 130 virtual bool AlphaBlendUsed() const; | |
| 131 | |
| 132 #if defined(OS_WIN) | 127 #if defined(OS_WIN) |
| 133 // Loads a SkPath into the GDI context. The path can there after be used for | 128 // Loads a SkPath into the GDI context. The path can there after be used for |
| 134 // clipping or as a stroke. Returns false if the path failed to be loaded. | 129 // clipping or as a stroke. Returns false if the path failed to be loaded. |
| 135 static bool LoadPathToDC(HDC context, const SkPath& path); | 130 static bool LoadPathToDC(HDC context, const SkPath& path); |
| 136 | 131 |
| 137 // Loads a SkRegion into the GDI context. | 132 // Loads a SkRegion into the GDI context. |
| 138 static void LoadClippingRegionToDC(HDC context, const SkRegion& region, | 133 static void LoadClippingRegionToDC(HDC context, const SkRegion& region, |
| 139 const SkMatrix& transformation); | 134 const SkMatrix& transformation); |
| 140 #elif defined(OS_MACOSX) | 135 #elif defined(OS_MACOSX) |
| 141 // Loads a SkPath into the CG context. The path can there after be used for | 136 // Loads a SkPath into the CG context. The path can there after be used for |
| (...skipping 27 matching lines...) Expand all Loading... |
| 169 #elif defined(OS_MACOSX) | 164 #elif defined(OS_MACOSX) |
| 170 // Loads the specified Skia transform into the device context | 165 // Loads the specified Skia transform into the device context |
| 171 static void LoadTransformToCGContext(CGContextRef context, | 166 static void LoadTransformToCGContext(CGContextRef context, |
| 172 const SkMatrix& matrix); | 167 const SkMatrix& matrix); |
| 173 #endif | 168 #endif |
| 174 }; | 169 }; |
| 175 | 170 |
| 176 } // namespace skia | 171 } // namespace skia |
| 177 | 172 |
| 178 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 173 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
| OLD | NEW |