diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 06:25:29 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 06:25:29 +0000 |
commit | 1e76b50130c7b40ad04eecaa0bc9b0b3d6e9afeb (patch) | |
tree | 0782e9be1a44505f5b150c8799cf8f8e7ac03cb5 /ui/message_center | |
parent | 4435d85a84dea66259432cf50e78eb9b97651ec8 (diff) | |
download | chromium_src-1e76b50130c7b40ad04eecaa0bc9b0b3d6e9afeb.zip chromium_src-1e76b50130c7b40ad04eecaa0bc9b0b3d6e9afeb.tar.gz chromium_src-1e76b50130c7b40ad04eecaa0bc9b0b3d6e9afeb.tar.bz2 |
GetScaleFactorForNativeView should return scale factor in float
Step 1 to reduce the use of ui::ScaleFactor and
eliminate ui::GetImageScale
BUG=372212
R=ananta@chromium.org, sky@chromium.org
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/293563002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/views/notification_view.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc index 0884205..a0e78f7 100644 --- a/ui/message_center/views/notification_view.cc +++ b/ui/message_center/views/notification_view.cc @@ -82,16 +82,12 @@ scoped_ptr<views::Border> MakeSeparatorBorder(int top, // Return true if and only if the image is null or has alpha. bool HasAlpha(gfx::ImageSkia& image, views::Widget* widget) { // Determine which bitmap to use. - ui::ScaleFactor factor = ui::SCALE_FACTOR_100P; - if (widget) { + float factor = 1.0f; + if (widget) factor = ui::GetScaleFactorForNativeView(widget->GetNativeView()); - if (factor == ui::SCALE_FACTOR_NONE) - factor = ui::SCALE_FACTOR_100P; - } // Extract that bitmap's alpha and look for a non-opaque pixel there. - SkBitmap bitmap = - image.GetRepresentation(ui::GetImageScale(factor)).sk_bitmap(); + SkBitmap bitmap = image.GetRepresentation(factor).sk_bitmap(); if (!bitmap.isNull()) { SkBitmap alpha; bitmap.extractAlpha(&alpha); |