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

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

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | « trunk/src/ui/gfx/image/image_skia_util_ios.mm ('k') | trunk/src/ui/gfx/image/image_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/gfx/image/image_skia_util_mac.mm
===================================================================
--- trunk/src/ui/gfx/image/image_skia_util_mac.mm (revision 224498)
+++ trunk/src/ui/gfx/image/image_skia_util_mac.mm (working copy)
@@ -57,11 +57,12 @@
if (IsNSImageEmpty(image))
return gfx::ImageSkia();
- std::vector<float> supported_scales = ImageSkia::GetSupportedScales();
+ std::vector<ui::ScaleFactor> supported_scale_factors =
+ ui::GetSupportedScaleFactors();
gfx::ImageSkia image_skia;
- for (size_t i = 0; i < supported_scales.size(); ++i) {
- float scale = supported_scales[i];
+ for (size_t i = 0; i < supported_scale_factors.size(); ++i) {
+ float scale = ui::GetScaleFactorScale(supported_scale_factors[i]);
NSSize desired_size_for_scale = NSMakeSize(desired_size.width * scale,
desired_size.height * scale);
NSImageRep* ns_image_rep = GetNSImageRepWithPixelSize(image,
@@ -72,7 +73,8 @@
if (bitmap.isNull())
continue;
- image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale));
+ image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap,
+ supported_scale_factors[i]));
}
return image_skia;
}
@@ -88,7 +90,7 @@
return nil;
base::scoped_nsobject<NSImage> image([[NSImage alloc] init]);
- image_skia.EnsureRepsForSupportedScales();
+ 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) {
@@ -106,7 +108,7 @@
return nil;
base::scoped_nsobject<NSImage> image([[NSImage alloc] init]);
- image_skia.EnsureRepsForSupportedScales();
+ 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) {
« no previous file with comments | « trunk/src/ui/gfx/image/image_skia_util_ios.mm ('k') | trunk/src/ui/gfx/image/image_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698