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

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

Issue 10834382: mac: Remove implicit conversion from ImageSkia to SkBitmap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 7
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque); 79 SK_API SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque);
80 80
81 // Draws an NSImageRep with a given size into a SkBitmap. 81 // Draws an NSImageRep with a given size into a SkBitmap.
82 SK_API SkBitmap NSImageRepToSkBitmap( 82 SK_API SkBitmap NSImageRepToSkBitmap(
83 NSImageRep* image, NSSize size, bool is_opaque); 83 NSImageRep* image, NSSize size, bool is_opaque);
84 84
85 // Given an SkBitmap, return an autoreleased NSBitmapImageRep in the generic 85 // Given an SkBitmap, return an autoreleased NSBitmapImageRep in the generic
86 // color space. 86 // color space.
87 SK_API NSBitmapImageRep* SkBitmapToNSBitmapImageRep(const SkBitmap& image); 87 SK_API NSBitmapImageRep* SkBitmapToNSBitmapImageRep(const SkBitmap& image);
88 88
89 SK_API NSBitmapImageRep* SkBitmapToNSBitmapImageRepWithColorSpace(
90 const SkBitmap& skiaBitmap,
91 CGColorSpaceRef colorSpace);
92
89 // Given an SkBitmap and a color space, return an autoreleased NSImage. 93 // Given an SkBitmap and a color space, return an autoreleased NSImage.
90 SK_API NSImage* SkBitmapToNSImageWithColorSpace(const SkBitmap& icon, 94 SK_API NSImage* SkBitmapToNSImageWithColorSpace(const SkBitmap& icon,
91 CGColorSpaceRef colorSpace); 95 CGColorSpaceRef colorSpace);
92 96
93 // Given an SkBitmap, return an autoreleased NSImage in the generic color space. 97 // Given an SkBitmap, return an autoreleased NSImage in the generic color space.
94 // DEPRECATED, use SkBitmapToNSImageWithColorSpace() instead. 98 // DEPRECATED, use SkBitmapToNSImageWithColorSpace() instead.
95 // TODO(thakis): Remove this -- http://crbug.com/69432 99 // TODO(thakis): Remove this -- http://crbug.com/69432
96 SK_API NSImage* SkBitmapToNSImage(const SkBitmap& icon); 100 SK_API NSImage* SkBitmapToNSImage(const SkBitmap& icon);
97 101
98 // Converts a SkCanvas temporarily to a CGContext 102 // Converts a SkCanvas temporarily to a CGContext
99 class SK_API SkiaBitLocker { 103 class SK_API SkiaBitLocker {
100 public: 104 public:
101 explicit SkiaBitLocker(SkCanvas* canvas); 105 explicit SkiaBitLocker(SkCanvas* canvas);
102 ~SkiaBitLocker(); 106 ~SkiaBitLocker();
103 CGContextRef cgContext(); 107 CGContextRef cgContext();
104 108
105 private: 109 private:
106 void releaseIfNeeded(); 110 void releaseIfNeeded();
107 SkCanvas* canvas_; 111 SkCanvas* canvas_;
108 CGContextRef cgContext_; 112 CGContextRef cgContext_;
109 SkBitmap bitmap_; 113 SkBitmap bitmap_;
110 bool useDeviceBits_; 114 bool useDeviceBits_;
111 }; 115 };
112 116
113 117
114 } // namespace gfx 118 } // namespace gfx
115 119
116 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ 120 #endif // SKIA_EXT_SKIA_UTILS_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm ('k') | skia/ext/skia_utils_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698