From 1e76b50130c7b40ad04eecaa0bc9b0b3d6e9afeb Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Tue, 20 May 2014 06:25:29 +0000 Subject: 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 --- ui/message_center/views/notification_view.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'ui/message_center') 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 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); -- cgit v1.1