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 BASE_GFX_PLATFORM_DEVICE_MAC_H__ | 5 #ifndef BASE_GFX_PLATFORM_DEVICE_MAC_H__ |
6 #define BASE_GFX_PLATFORM_DEVICE_MAC_H__ | 6 #define BASE_GFX_PLATFORM_DEVICE_MAC_H__ |
7 | 7 |
8 #import <ApplicationServices/ApplicationServices.h> | 8 #import <ApplicationServices/ApplicationServices.h> |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // the entirety of the source device will be copied. | 52 // the entirety of the source device will be copied. |
53 virtual void DrawToContext(CGContextRef context, int x, int y, | 53 virtual void DrawToContext(CGContextRef context, int x, int y, |
54 const CGRect* src_rect) = 0; | 54 const CGRect* src_rect) = 0; |
55 | 55 |
56 // Sets the opacity of each pixel in the specified region to be opaque. | 56 // Sets the opacity of each pixel in the specified region to be opaque. |
57 void makeOpaque(int x, int y, int width, int height); | 57 void makeOpaque(int x, int y, int width, int height); |
58 | 58 |
59 // Returns if the preferred rendering engine is vectorial or bitmap based. | 59 // Returns if the preferred rendering engine is vectorial or bitmap based. |
60 virtual bool IsVectorial() = 0; | 60 virtual bool IsVectorial() = 0; |
61 | 61 |
| 62 // On platforms where the native rendering API does not support rendering |
| 63 // into bitmaps with a premultiplied alpha channel, this call is responsible |
| 64 // for doing any fixup necessary. It is not used on the Mac, since |
| 65 // CoreGraphics can handle premultiplied alpha just fine. |
| 66 virtual void fixupAlphaBeforeCompositing() = 0; |
| 67 |
62 // Initializes the default settings and colors in a device context. | 68 // Initializes the default settings and colors in a device context. |
63 static void InitializeCGContext(CGContextRef context); | 69 static void InitializeCGContext(CGContextRef context); |
64 | 70 |
65 // Loads a SkPath into the CG context. The path can there after be used for | 71 // Loads a SkPath into the CG context. The path can there after be used for |
66 // clipping or as a stroke. | 72 // clipping or as a stroke. |
67 static void LoadPathToCGContext(CGContextRef context, const SkPath& path); | 73 static void LoadPathToCGContext(CGContextRef context, const SkPath& path); |
68 | 74 |
69 protected: | 75 protected: |
70 // Forwards |bitmap| to SkDevice's constructor. | 76 // Forwards |bitmap| to SkDevice's constructor. |
71 PlatformDeviceMac(const SkBitmap& bitmap); | 77 PlatformDeviceMac(const SkBitmap& bitmap); |
(...skipping 12 matching lines...) Expand all Loading... |
84 int y, | 90 int y, |
85 int width, | 91 int width, |
86 int height, | 92 int height, |
87 adjustAlpha adjustor) = 0; | 93 adjustAlpha adjustor) = 0; |
88 }; | 94 }; |
89 | 95 |
90 } // namespace gfx | 96 } // namespace gfx |
91 | 97 |
92 #endif // BASE_GFX_PLATFORM_DEVICE_MAC_H__ | 98 #endif // BASE_GFX_PLATFORM_DEVICE_MAC_H__ |
93 | 99 |
OLD | NEW |