From 50b66263c3a926fd1de75248fb2100e72715696e Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Tue, 24 Sep 2013 03:25:48 +0000 Subject: Remove dependency on ui::ScaleFactor from ui/gfx As part of the work to removed dependencies on ui/base from ui/gfx I have changed the public api to Canvas, ImageSkia, ImageSkiaRep and ImagePNGRep to take float scale values instead of ui::ScaleFactor. The notion of supported scale factors has been broken into 2 parts. ui::SetSupportedScaleFactors remains and calls the new ImageSkia::SetSupportedScales(). The initialization of the supported scale factors has been moved from layout.h into ResourceBundle, and is done explicitly in tests that don't use ResourceBundle. BUG=103304 R=ben@chromium.org, oshima@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=224473 Review URL: https://codereview.chromium.org/24175004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224876 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/system/chromeos/network/network_icon.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'ash/system/chromeos') diff --git a/ash/system/chromeos/network/network_icon.cc b/ash/system/chromeos/network/network_icon.cc index 5e914e7..d3c4899 100644 --- a/ash/system/chromeos/network/network_icon.cc +++ b/ash/system/chromeos/network/network_icon.cc @@ -196,13 +196,12 @@ class EmptyImageSource: public gfx::ImageSkiaSource { : size_(size) { } - virtual gfx::ImageSkiaRep GetImageForScale( - ui::ScaleFactor scale_factor) OVERRIDE { - gfx::Size pixel_size = gfx::ToFlooredSize( - gfx::ScaleSize(size_, ui::GetScaleFactorScale(scale_factor))); + virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { + gfx::Size pixel_size = gfx::ToFlooredSize(gfx::ScaleSize(size_, scale)); SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size); - return gfx::ImageSkiaRep(empty_bitmap, scale_factor); + return gfx::ImageSkiaRep(empty_bitmap, scale); } + private: const gfx::Size size_; @@ -220,9 +219,8 @@ class NetworkIconImageSource : public gfx::ImageSkiaSource { // TODO(pkotwicz): Figure out what to do when a new image resolution becomes // available. - virtual gfx::ImageSkiaRep GetImageForScale( - ui::ScaleFactor scale_factor) OVERRIDE { - gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale_factor); + virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { + gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale); if (icon_rep.is_null()) return gfx::ImageSkiaRep(); gfx::Canvas canvas(icon_rep, false); -- cgit v1.1