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_MAC_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <ApplicationServices/ApplicationServices.h> | 9 #import <ApplicationServices/ApplicationServices.h> |
10 #include "third_party/skia/include/core/SkDevice.h" | 10 #include "third_party/skia/include/core/SkDevice.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // the entirety of the source device will be copied. | 37 // the entirety of the source device will be copied. |
38 virtual void DrawToContext(CGContextRef context, int x, int y, | 38 virtual void DrawToContext(CGContextRef context, int x, int y, |
39 const CGRect* src_rect) = 0; | 39 const CGRect* src_rect) = 0; |
40 | 40 |
41 // Returns if the preferred rendering engine is vectorial or bitmap based. | 41 // Returns if the preferred rendering engine is vectorial or bitmap based. |
42 virtual bool IsVectorial() = 0; | 42 virtual bool IsVectorial() = 0; |
43 | 43 |
44 // Returns if native platform APIs are allowed to render text to this device. | 44 // Returns if native platform APIs are allowed to render text to this device. |
45 virtual bool IsNativeFontRenderingAllowed(); | 45 virtual bool IsNativeFontRenderingAllowed(); |
46 | 46 |
| 47 virtual PlatformSurface BeginPlatformPaint(); |
| 48 virtual void EndPlatformPaint(); |
| 49 |
47 // Initializes the default settings and colors in a device context. | 50 // Initializes the default settings and colors in a device context. |
48 static void InitializeCGContext(CGContextRef context); | 51 static void InitializeCGContext(CGContextRef context); |
49 | 52 |
50 // Loads a SkPath into the CG context. The path can there after be used for | 53 // Loads a SkPath into the CG context. The path can there after be used for |
51 // clipping or as a stroke. | 54 // clipping or as a stroke. |
52 static void LoadPathToCGContext(CGContextRef context, const SkPath& path); | 55 static void LoadPathToCGContext(CGContextRef context, const SkPath& path); |
53 | 56 |
54 // Loads a SkRegion into the CG context. | 57 // Loads a SkRegion into the CG context. |
55 static void LoadClippingRegionToCGContext(CGContextRef context, | 58 static void LoadClippingRegionToCGContext(CGContextRef context, |
56 const SkRegion& region, | 59 const SkRegion& region, |
57 const SkMatrix& transformation); | 60 const SkMatrix& transformation); |
58 | 61 |
59 protected: | 62 protected: |
60 // Forwards |bitmap| to SkDevice's constructor. | 63 // Forwards |bitmap| to SkDevice's constructor. |
61 PlatformDevice(const SkBitmap& bitmap); | 64 PlatformDevice(const SkBitmap& bitmap); |
62 | 65 |
63 // Loads the specified Skia transform into the device context | 66 // Loads the specified Skia transform into the device context |
64 static void LoadTransformToCGContext(CGContextRef context, | 67 static void LoadTransformToCGContext(CGContextRef context, |
65 const SkMatrix& matrix); | 68 const SkMatrix& matrix); |
66 }; | 69 }; |
67 | 70 |
68 } // namespace skia | 71 } // namespace skia |
69 | 72 |
70 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 73 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
71 | 74 |
OLD | NEW |