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

Unified Diff: base/mac_util.h

Issue 3072005: Move NSImage-to-CGImageRef conversion code into a common helper function in base/mac_util.h. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix test Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/mac_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac_util.h
diff --git a/base/mac_util.h b/base/mac_util.h
index 4be3c895b996fdeee7168e6e01a596ce754dba0b..d50e9e3cf9aa924fccad2ffb3d3acda6f5f65dee 100644
--- a/base/mac_util.h
+++ b/base/mac_util.h
@@ -17,6 +17,7 @@ class FilePath;
@class NSWindow;
#else
class NSBundle;
+class NSImage;
class NSWindow;
#endif
@@ -141,6 +142,13 @@ CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
// Sets the process name as displayed in Activity Monitor to process_name.
void SetProcessName(CFStringRef process_name);
+// Converts a NSImage to a CGImageRef. Normally, the system frameworks can do
+// this fine, especially on 10.6. On 10.5, however, CGImage cannot handle
+// converting a PDF-backed NSImage into a CGImageRef. This function will
+// rasterize the PDF into a bitmap CGImage. The caller is responsible for
+// releasing the return value.
+CGImageRef CopyNSImageToCGImage(NSImage* image);
+
} // namespace mac_util
#endif // BASE_MAC_UTIL_H_
« no previous file with comments | « no previous file | base/mac_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698