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

Unified Diff: app/resource_bundle_mac.mm

Issue 173363: Add a helper to resource bundle to get an NSImage back.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/resource_bundle.h ('k') | skia/skia.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/resource_bundle_mac.mm
===================================================================
--- app/resource_bundle_mac.mm (revision 24269)
+++ app/resource_bundle_mac.mm (working copy)
@@ -17,6 +17,7 @@
#include "base/path_service.h"
#include "base/string_piece.h"
#include "base/string_util.h"
+#include "skia/ext/skia_utils_mac.h"
ResourceBundle::~ResourceBundle() {
FreeImages();
@@ -116,3 +117,14 @@
data.length() / 2);
return msg;
}
+
+NSImage* ResourceBundle::GetNSImageNamed(int resource_id) {
+ // Currently this doesn't make a cache holding these as NSImages because
+ // GetBitmapNamed has a cache, and we don't want to double cache.
+ SkBitmap* bitmap = GetBitmapNamed(resource_id);
+ if (!bitmap)
+ return nil;
+
+ NSImage* nsimage = gfx::SkBitmapToNSImage(*bitmap);
+ return nsimage;
+}
« no previous file with comments | « app/resource_bundle.h ('k') | skia/skia.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698