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

Side by Side 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: Fixed touchui 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 unified diff | Download patch | Annotate | Revision Log
« ui/gfx/image.h ('K') | « ui/gfx/image.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import <AppKit/AppKit.h> 5 #import <AppKit/AppKit.h>
6 6
7 #include "skia/ext/skia_utils_mac.h" 7 #include "skia/ext/skia_utils_mac.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 namespace internal { 11 namespace internal {
12 12
13 const SkBitmap* NSImageToSkBitmap(NSImage* image) { 13 bool NSImageToSkBitmaps(NSImage* image, std::vector<const SkBitmap*>& bitmaps) {
14 return new SkBitmap(::gfx::NSImageToSkBitmap(image, [image size], false)); 14 for (NSImageRep* imageRep in [image representations]) {
15 SkBitmap bitmap(gfx::NSImageRepToSkBitmap(imageRep,
Robert Sesek 2011/04/15 20:27:20 Use a scoped_ptr<> here and .release() if you end
sail 2011/04/16 01:25:00 Done.
16 [imageRep size], false));
17 if (bitmap.isNull())
18 return false;
19 bitmaps.push_back(new SkBitmap(bitmap));
20 }
21 return true;
15 } 22 }
16 23
17 } // namespace internal 24 } // namespace internal
18 } // namespace gfx 25 } // namespace gfx
OLDNEW
« ui/gfx/image.h ('K') | « ui/gfx/image.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698