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

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

Issue 11293147: Always add 100P scale format in the supported format list. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding TODO. Created 8 years, 1 month 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_ios.mm ('k') | ui/gfx/image/image_unittest_util.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_ios.mm
diff --git a/ui/gfx/image/image_skia_util_ios.mm b/ui/gfx/image/image_skia_util_ios.mm
index c037e5c7f3203dc33f795584736802d9c96988f4..78c8bafb8b1f4e9450fcda84431cde00e39a421d 100644
--- a/ui/gfx/image/image_skia_util_ios.mm
+++ b/ui/gfx/image/image_skia_util_ios.mm
@@ -19,14 +19,7 @@ gfx::ImageSkia ImageSkiaFromUIImage(UIImage* image) {
if (!image)
return image_skia;
- // iOS only supports one scale factor.
- std::vector<ui::ScaleFactor> supported_scale_factors =
- ui::GetSupportedScaleFactors();
- DCHECK_EQ(1U, supported_scale_factors.size());
- if (supported_scale_factors.size() < 1)
- return image_skia;
-
- ui::ScaleFactor scale_factor = supported_scale_factors[0];
+ ui::ScaleFactor scale_factor = ui::GetMaxScaleFactor();
float scale = ui::GetScaleFactorScale(scale_factor);
CGSize size = image.size;
CGSize desired_size_for_scale =
@@ -43,18 +36,10 @@ UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia) {
if (image_skia.isNull())
return nil;
- // iOS only supports one scale factor.
- std::vector<ui::ScaleFactor> supported_scale_factors =
- ui::GetSupportedScaleFactors();
- DCHECK_EQ(1U, supported_scale_factors.size());
- if (supported_scale_factors.size() < 1)
- return nil;
-
- ui::ScaleFactor scale_factor = supported_scale_factors[0];
+ ui::ScaleFactor scale_factor = ui::GetMaxScaleFactor();
float scale = ui::GetScaleFactorScale(scale_factor);
image_skia.EnsureRepsForSupportedScaleFactors();
- const ImageSkiaRep& rep =
- image_skia.GetRepresentation(supported_scale_factors[0]);
+ const ImageSkiaRep& rep = image_skia.GetRepresentation(scale_factor);
base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
return gfx::SkBitmapToUIImageWithColorSpace(rep.sk_bitmap(), scale,
« no previous file with comments | « ui/gfx/image/image_ios.mm ('k') | ui/gfx/image/image_unittest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698