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

Unified Diff: ui/base/resource/resource_bundle_mac.mm

Issue 6541031: Integrate gfx::Image into the ResourceBundle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/resource/resource_bundle_mac.mm
diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm
index e859b1c09e607d16aa9b2ce4433be68331ff7af0..f7bc0f8c00bef7c26c554a031559f814c92afa3c 100644
--- a/ui/base/resource/resource_bundle_mac.mm
+++ b/ui/base/resource/resource_bundle_mac.mm
@@ -58,15 +58,11 @@ FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) {
return GetResourcesPakFilePath(@"locale", mac_locale);
}
-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;
+gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
+ // Currently this just returns the Skia-backed image, which will convert to
+ // NSImage and cache that result when necessary.
+ // TODO(rsesek): Load the raw bytes directly into an NSImage instead.
+ return GetImageNamed(resource_id);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698