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

Unified Diff: ui/gfx/image/image_skia_util_mac.mm

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 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
« ui/gfx/image/image_skia.h ('K') | « ui/gfx/image/image_skia_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia_util_mac.mm
diff --git a/ui/gfx/image/image_skia_util_mac.mm b/ui/gfx/image/image_skia_util_mac.mm
index 5eb618550912dea54d207d537a9a34229e31f9c7..226953bb77266394e73a94584c9ac6151445482f 100644
--- a/ui/gfx/image/image_skia_util_mac.mm
+++ b/ui/gfx/image/image_skia_util_mac.mm
@@ -90,8 +90,8 @@ NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) {
return nil;
scoped_nsobject<NSImage> image([[NSImage alloc] init]);
-
- std::vector<gfx::ImageSkiaRep> image_reps = image_skia.GetRepresentations();
+ image_skia.EnsureRepsForSupportedScaleFactors();
+ std::vector<gfx::ImageSkiaRep> image_reps = image_skia.image_reps();
for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin();
it != image_reps.end(); ++it) {
[image addRepresentation:
@@ -108,9 +108,8 @@ NSImage* NSImageFromImageSkiaWithColorSpace(const gfx::ImageSkia& image_skia,
return nil;
scoped_nsobject<NSImage> image([[NSImage alloc] init]);
-
- const std::vector<gfx::ImageSkiaRep>& image_reps =
- image_skia.GetRepresentations();
+ image_skia.EnsureRepsForSupportedScaleFactors();
+ std::vector<gfx::ImageSkiaRep> image_reps = image_skia.image_reps();
for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin();
it != image_reps.end(); ++it) {
[image addRepresentation:
« ui/gfx/image/image_skia.h ('K') | « ui/gfx/image/image_skia_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698