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

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 Created 8 years, 9 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. Returns raw rgb values and does no colorspace
68 // conversion. Only valid for colors in calibrated and device color spaces.
69 SK_API SkColor NSDeviceColorToSkColor(NSColor* color);
70
67 // Converts ARGB to NSColor. 71 // Converts ARGB to NSColor.
68 SK_API NSColor* SkColorToCalibratedNSColor(SkColor color); 72 SK_API NSColor* SkColorToCalibratedNSColor(SkColor color);
73 SK_API NSColor* SkColorToDeviceNSColor(SkColor color);
69 74
70 // Converts a CGImage to a SkBitmap. 75 // Converts a CGImage to a SkBitmap.
71 SK_API SkBitmap CGImageToSkBitmap(CGImageRef image); 76 SK_API SkBitmap CGImageToSkBitmap(CGImageRef image);
72 77
73 // Draws an NSImage with a given size into a SkBitmap. 78 // Draws an NSImage with a given size into a SkBitmap.
74 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); 79 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque);
75 80
76 // Draws an NSImageRep with a given size into a SkBitmap. 81 // Draws an NSImageRep with a given size into a SkBitmap.
77 SK_API SkBitmap NSImageRepToSkBitmap( 82 SK_API SkBitmap NSImageRepToSkBitmap(
78 NSImageRep* image, NSSize size, bool is_opaque); 83 NSImageRep* image, NSSize size, bool is_opaque);
(...skipping 24 matching lines...) Expand all
103 private: 108 private:
104 void releaseIfNeeded(); 109 void releaseIfNeeded();
105 SkCanvas* canvas_; 110 SkCanvas* canvas_;
106 CGContextRef cgContext_; 111 CGContextRef cgContext_;
107 }; 112 };
108 113
109 114
110 } // namespace gfx 115 } // namespace gfx
111 116
112 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ 117 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698