| 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_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 <CoreGraphics/CGColor.h> | 8 #include <CoreGraphics/CGColor.h> |
| 9 | 9 |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Converts ARGB to CGColorRef. | 51 // Converts ARGB to CGColorRef. |
| 52 CGColorRef SkColorToCGColorRef(SkColor color); | 52 CGColorRef SkColorToCGColorRef(SkColor color); |
| 53 | 53 |
| 54 // Converts a CGImage to a SkBitmap. | 54 // Converts a CGImage to a SkBitmap. |
| 55 SkBitmap CGImageToSkBitmap(CGImageRef image); | 55 SkBitmap CGImageToSkBitmap(CGImageRef image); |
| 56 | 56 |
| 57 #ifdef __OBJC__ | 57 #ifdef __OBJC__ |
| 58 // Draws an NSImage with a given size into a SkBitmap. | 58 // Draws an NSImage with a given size into a SkBitmap. |
| 59 SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); | 59 SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); |
| 60 |
| 61 // Given an SkBitmap, return an autoreleased NSImage. |
| 62 NSImage* SkBitmapToNSImage(const SkBitmap& icon); |
| 60 #endif | 63 #endif |
| 61 | 64 |
| 62 } // namespace gfx | 65 } // namespace gfx |
| 63 | 66 |
| 64 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ | 67 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ |
| OLD | NEW |