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_SKIA_UTILS_MAC_H_ | 5 #ifndef SKIA_EXT_SKIA_UTILS_MAC_H_ |
6 #define SKIA_EXT_SKIA_UTILS_MAC_H_ | 6 #define SKIA_EXT_SKIA_UTILS_MAC_H_ |
7 | 7 |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Converts a CoreGraphics point to a Skia CGPoint. | 45 // Converts a CoreGraphics point to a Skia CGPoint. |
46 // Both use same in-memory format. | 46 // Both use same in-memory format. |
47 inline const SkPoint& CGPointToSkPoint(const CGPoint& point) { | 47 inline const SkPoint& CGPointToSkPoint(const CGPoint& point) { |
48 return reinterpret_cast<const SkPoint&>(point); | 48 return reinterpret_cast<const SkPoint&>(point); |
49 } | 49 } |
50 | 50 |
51 // Matrix converters. | 51 // Matrix converters. |
52 SK_API CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix); | 52 SK_API CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix); |
53 | 53 |
54 // Rectangle converters. | 54 // Rectangle converters. |
55 SkRect CGRectToSkRect(const CGRect& rect); | 55 SK_API SkRect CGRectToSkRect(const CGRect& rect); |
56 | 56 |
57 // Converts a Skia rect to a CoreGraphics CGRect. | 57 // Converts a Skia rect to a CoreGraphics CGRect. |
58 CGRect SkIRectToCGRect(const SkIRect& rect); | 58 CGRect SkIRectToCGRect(const SkIRect& rect); |
59 CGRect SkRectToCGRect(const SkRect& rect); | 59 CGRect SkRectToCGRect(const SkRect& rect); |
60 | 60 |
61 // Converts CGColorRef to the ARGB layout Skia expects. | 61 // Converts CGColorRef to the ARGB layout Skia expects. |
62 SK_API SkColor CGColorRefToSkColor(CGColorRef color); | 62 SK_API SkColor CGColorRefToSkColor(CGColorRef color); |
63 | 63 |
64 // Converts ARGB to CGColorRef. | 64 // Converts ARGB to CGColorRef. |
65 SK_API CGColorRef CGColorCreateFromSkColor(SkColor color); | 65 SK_API CGColorRef CGColorCreateFromSkColor(SkColor color); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 SkCanvas* canvas_; | 111 SkCanvas* canvas_; |
112 CGContextRef cgContext_; | 112 CGContextRef cgContext_; |
113 SkBitmap bitmap_; | 113 SkBitmap bitmap_; |
114 bool useDeviceBits_; | 114 bool useDeviceBits_; |
115 }; | 115 }; |
116 | 116 |
117 | 117 |
118 } // namespace gfx | 118 } // namespace gfx |
119 | 119 |
120 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ | 120 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ |
OLD | NEW |