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

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

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler 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 | « ui/gfx/image/image_skia_util_ios.mm ('k') | ui/gfx/image/image_unittest.cc » ('j') | 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 f9d0475af7fc1f77c67a63e58a3b0f190177b45f..64f95d65bfdfb8894399a8fd55e8062409e412ee 100644
--- a/ui/gfx/image/image_skia_util_mac.mm
+++ b/ui/gfx/image/image_skia_util_mac.mm
@@ -57,12 +57,11 @@ gfx::ImageSkia ImageSkiaFromResizedNSImage(NSImage* image,
if (IsNSImageEmpty(image))
return gfx::ImageSkia();
- std::vector<ui::ScaleFactor> supported_scale_factors =
- ui::GetSupportedScaleFactors();
+ std::vector<float> supported_scales = ImageSkia::GetSupportedScales();
gfx::ImageSkia image_skia;
- for (size_t i = 0; i < supported_scale_factors.size(); ++i) {
- float scale = ui::GetScaleFactorScale(supported_scale_factors[i]);
+ for (size_t i = 0; i < supported_scales.size(); ++i) {
+ float scale = supported_scales[i];
NSSize desired_size_for_scale = NSMakeSize(desired_size.width * scale,
desired_size.height * scale);
NSImageRep* ns_image_rep = GetNSImageRepWithPixelSize(image,
@@ -73,8 +72,7 @@ gfx::ImageSkia ImageSkiaFromResizedNSImage(NSImage* image,
if (bitmap.isNull())
continue;
- image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap,
- supported_scale_factors[i]));
+ image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale));
}
return image_skia;
}
@@ -90,7 +88,7 @@ NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) {
return nil;
base::scoped_nsobject<NSImage> image([[NSImage alloc] init]);
- image_skia.EnsureRepsForSupportedScaleFactors();
+ image_skia.EnsureRepsForSupportedScales();
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) {
@@ -108,7 +106,7 @@ NSImage* NSImageFromImageSkiaWithColorSpace(const gfx::ImageSkia& image_skia,
return nil;
base::scoped_nsobject<NSImage> image([[NSImage alloc] init]);
- image_skia.EnsureRepsForSupportedScaleFactors();
+ image_skia.EnsureRepsForSupportedScales();
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 | « ui/gfx/image/image_skia_util_ios.mm ('k') | ui/gfx/image/image_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698