diff options
author | danakj <danakj@chromium.org> | 2015-09-25 12:38:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-25 19:39:49 +0000 |
commit | ddaec91ec046e8a389d16049c0a2656a4e41a2ad (patch) | |
tree | ae2d490de25a87631a75962d2b70d93f7b64f7a8 /extensions/browser/extension_icon_image.cc | |
parent | a0ea3c2db857d5821b63a52e3bd5704cec218f84 (diff) | |
download | chromium_src-ddaec91ec046e8a389d16049c0a2656a4e41a2ad.zip chromium_src-ddaec91ec046e8a389d16049c0a2656a4e41a2ad.tar.gz chromium_src-ddaec91ec046e8a389d16049c0a2656a4e41a2ad.tar.bz2 |
gfx: Make conversions from Size to SizeF be explicit.
This removes the implicit operator from Size to SizeF and adds an
explicit constructor instead.
There are many places in the code that want to do:
an_integer_size = ToFlooredSize(ScaleSize(an_integer_size, x));
This would make these all look like
an_integer_size = ToFlooredSize(ScaleSize(gfx::RectF(an_integer_size), x));
But that's pretty verbose. So add helpers similar to those we have
already for gfx::Rect, for when you want to scale a Size to a Size,
such as
an_integer_size = ScaleToFlooredSize(an_integer_size, x);
R=sky@chromium.org, vmpstr
BUG=342848
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1357423009
Cr-Commit-Position: refs/heads/master@{#350889}
Diffstat (limited to 'extensions/browser/extension_icon_image.cc')
-rw-r--r-- | extensions/browser/extension_icon_image.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc index 023879f..c0ab8d5 100644 --- a/extensions/browser/extension_icon_image.cc +++ b/extensions/browser/extension_icon_image.cc @@ -196,10 +196,9 @@ gfx::ImageSkiaRep IconImage::LoadImageForScaleFactor( std::vector<ImageLoader::ImageRepresentation> info_list; info_list.push_back(ImageLoader::ImageRepresentation( - resource, - ImageLoader::ImageRepresentation::ALWAYS_RESIZE, - gfx::ToFlooredSize(gfx::ScaleSize( - gfx::Size(resource_size_in_dip_, resource_size_in_dip_), scale)), + resource, ImageLoader::ImageRepresentation::ALWAYS_RESIZE, + gfx::ScaleToFlooredSize( + gfx::Size(resource_size_in_dip_, resource_size_in_dip_), scale), scale_factor)); extensions::ImageLoader* loader = |