| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <ApplicationServices/ApplicationServices.h> | 9 #include <ApplicationServices/ApplicationServices.h> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Both use same in-memory format. | 45 // Both use same in-memory format. |
| 46 inline const SkPoint& CGPointToSkPoint(const CGPoint& point) { | 46 inline const SkPoint& CGPointToSkPoint(const CGPoint& point) { |
| 47 return reinterpret_cast<const SkPoint&>(point); | 47 return reinterpret_cast<const SkPoint&>(point); |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Matrix converters. | 50 // Matrix converters. |
| 51 SK_API CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix); | 51 SK_API CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix); |
| 52 | 52 |
| 53 // Rectangle converters. | 53 // Rectangle converters. |
| 54 SkRect CGRectToSkRect(const CGRect& rect); | 54 SkRect CGRectToSkRect(const CGRect& rect); |
| 55 SkIRect CGRectToSkIRect(const CGRect& rect); | |
| 56 | 55 |
| 57 // Converts a Skia rect to a CoreGraphics CGRect. | 56 // Converts a Skia rect to a CoreGraphics CGRect. |
| 58 CGRect SkIRectToCGRect(const SkIRect& rect); | 57 CGRect SkIRectToCGRect(const SkIRect& rect); |
| 59 CGRect SkRectToCGRect(const SkRect& rect); | 58 CGRect SkRectToCGRect(const SkRect& rect); |
| 60 | 59 |
| 61 // Converts CGColorRef to the ARGB layout Skia expects. | 60 // Converts CGColorRef to the ARGB layout Skia expects. |
| 62 SkColor CGColorRefToSkColor(CGColorRef color); | 61 SkColor CGColorRefToSkColor(CGColorRef color); |
| 63 | 62 |
| 64 // Converts ARGB to CGColorRef. | 63 // Converts ARGB to CGColorRef. |
| 65 CGColorRef SkColorToCGColorRef(SkColor color); | 64 CGColorRef SkColorToCGColorRef(SkColor color); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 private: | 102 private: |
| 104 void releaseIfNeeded(); | 103 void releaseIfNeeded(); |
| 105 SkCanvas* canvas_; | 104 SkCanvas* canvas_; |
| 106 CGContextRef cgContext_; | 105 CGContextRef cgContext_; |
| 107 }; | 106 }; |
| 108 | 107 |
| 109 | 108 |
| 110 } // namespace gfx | 109 } // namespace gfx |
| 111 | 110 |
| 112 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ | 111 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ |
| OLD | NEW |