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

Unified Diff: ui/gfx/image_mac.mm

Issue 6849030: Add support for multi resolution icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments Created 9 years, 8 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 | « ui/gfx/image.cc ('k') | ui/gfx/image_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image_mac.mm
diff --git a/ui/gfx/image_mac.mm b/ui/gfx/image_mac.mm
index b3dc9776ebf135835754539f38873801a45368c4..544c214ec843f53898cf5254c4057dd51bcaff7e 100644
--- a/ui/gfx/image_mac.mm
+++ b/ui/gfx/image_mac.mm
@@ -4,14 +4,22 @@
#import <AppKit/AppKit.h>
+#include "base/memory/scoped_ptr.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace gfx {
namespace internal {
-const SkBitmap* NSImageToSkBitmap(NSImage* image) {
- return new SkBitmap(::gfx::NSImageToSkBitmap(image, [image size], false));
+bool NSImageToSkBitmaps(NSImage* image, std::vector<const SkBitmap*>& bitmaps) {
+ for (NSImageRep* imageRep in [image representations]) {
+ scoped_ptr<SkBitmap> bitmap(new SkBitmap(
+ gfx::NSImageRepToSkBitmap(imageRep, [imageRep size], false)));
+ if (bitmap->isNull())
+ return false;
+ bitmaps.push_back(bitmap.release());
+ }
+ return true;
}
} // namespace internal
« no previous file with comments | « ui/gfx/image.cc ('k') | ui/gfx/image_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698