| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <CoreGraphics/CGColor.h> | 9 #include <CoreGraphics/CGColor.h> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Converts a Skia rect to a CoreGraphics CGRect. | 55 // Converts a Skia rect to a CoreGraphics CGRect. |
| 56 CGRect SkIRectToCGRect(const SkIRect& rect); | 56 CGRect SkIRectToCGRect(const SkIRect& rect); |
| 57 CGRect SkRectToCGRect(const SkRect& rect); | 57 CGRect SkRectToCGRect(const SkRect& rect); |
| 58 | 58 |
| 59 // Converts CGColorRef to the ARGB layout Skia expects. | 59 // Converts CGColorRef to the ARGB layout Skia expects. |
| 60 SkColor CGColorRefToSkColor(CGColorRef color); | 60 SkColor CGColorRefToSkColor(CGColorRef color); |
| 61 | 61 |
| 62 // Converts ARGB to CGColorRef. | 62 // Converts ARGB to CGColorRef. |
| 63 CGColorRef SkColorToCGColorRef(SkColor color); | 63 CGColorRef SkColorToCGColorRef(SkColor color); |
| 64 | 64 |
| 65 // Converts ARGB to NSColor. |
| 66 NSColor* SkColorToCalibratedNSColor(SkColor color); |
| 67 |
| 65 // Converts a CGImage to a SkBitmap. | 68 // Converts a CGImage to a SkBitmap. |
| 66 SkBitmap CGImageToSkBitmap(CGImageRef image); | 69 SkBitmap CGImageToSkBitmap(CGImageRef image); |
| 67 | 70 |
| 68 // Draws an NSImage with a given size into a SkBitmap. | 71 // Draws an NSImage with a given size into a SkBitmap. |
| 69 SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); | 72 SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); |
| 70 | 73 |
| 71 // Draws an NSImageRep with a given size into a SkBitmap. | 74 // Draws an NSImageRep with a given size into a SkBitmap. |
| 72 SkBitmap NSImageRepToSkBitmap(NSImageRep* image, NSSize size, bool is_opaque); | 75 SkBitmap NSImageRepToSkBitmap(NSImageRep* image, NSSize size, bool is_opaque); |
| 73 | 76 |
| 74 // Given an SkBitmap and a color space, return an autoreleased NSImage. | 77 // Given an SkBitmap and a color space, return an autoreleased NSImage. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 private: | 100 private: |
| 98 void releaseIfNeeded(); | 101 void releaseIfNeeded(); |
| 99 SkCanvas* canvas_; | 102 SkCanvas* canvas_; |
| 100 CGContextRef cgContext_; | 103 CGContextRef cgContext_; |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 | 106 |
| 104 } // namespace gfx | 107 } // namespace gfx |
| 105 | 108 |
| 106 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ | 109 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ |
| OLD | NEW |