Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: skia/ext/skia_utils_mac.h

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed issues Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <ApplicationServices/ApplicationServices.h> 9 #include <ApplicationServices/ApplicationServices.h>
10 #include <vector> 10 #include <vector>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkColor CGColorRefToSkColor(CGColorRef color); 62 SkColor CGColorRefToSkColor(CGColorRef color);
63 63
64 // Converts ARGB to CGColorRef. 64 // Converts ARGB to CGColorRef.
65 CGColorRef SkColorToCGColorRef(SkColor color); 65 CGColorRef SkColorToCGColorRef(SkColor color);
66 66
67 // Converts NSColor to ARGB
68 SkColor NSColorToSkColor(NSColor* color);
Nico 2012/02/21 19:40:17 This should mention color spaces somehow ("Returns
keishi 2012/02/24 14:38:54 Done.
69
67 // Converts ARGB to NSColor. 70 // Converts ARGB to NSColor.
68 SK_API NSColor* SkColorToCalibratedNSColor(SkColor color); 71 SK_API NSColor* SkColorToCalibratedNSColor(SkColor color);
72 SK_API NSColor* SkColorToDeviceNSColor(SkColor color);
69 73
70 // Converts a CGImage to a SkBitmap. 74 // Converts a CGImage to a SkBitmap.
71 SK_API SkBitmap CGImageToSkBitmap(CGImageRef image); 75 SK_API SkBitmap CGImageToSkBitmap(CGImageRef image);
72 76
73 // Draws an NSImage with a given size into a SkBitmap. 77 // Draws an NSImage with a given size into a SkBitmap.
74 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); 78 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque);
75 79
76 // Draws an NSImageRep with a given size into a SkBitmap. 80 // Draws an NSImageRep with a given size into a SkBitmap.
77 SK_API SkBitmap NSImageRepToSkBitmap( 81 SK_API SkBitmap NSImageRepToSkBitmap(
78 NSImageRep* image, NSSize size, bool is_opaque); 82 NSImageRep* image, NSSize size, bool is_opaque);
(...skipping 24 matching lines...) Expand all
103 private: 107 private:
104 void releaseIfNeeded(); 108 void releaseIfNeeded();
105 SkCanvas* canvas_; 109 SkCanvas* canvas_;
106 CGContextRef cgContext_; 110 CGContextRef cgContext_;
107 }; 111 };
108 112
109 113
110 } // namespace gfx 114 } // namespace gfx
111 115
112 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ 116 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698