// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/base/win/dpi_setup.h"

#include "ui/base/layout.h"
#include "ui/gfx/display.h"
#include "ui/gfx/win/dpi.h"

namespace ui {
namespace win {

void InitDeviceScaleFactor() {
  float scale = 1.0f;
  if (gfx::IsHighDPIEnabled()) {
    float scale = gfx::Display::HasForceDeviceScaleFactor() ?
        gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale();
    // Quantize to nearest supported scale factor.
    scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale));
  }
  gfx::InitDeviceScaleFactor(scale);
}

}  // namespace win
}  // namespace ui

// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/base/win/dpi_setup.h"

#include "ui/base/layout.h"
#include "ui/gfx/display.h"
#include "ui/gfx/win/dpi.h"

namespace ui {
namespace win {

void InitDeviceScaleFactor() {
  float scale = 1.0f;
  if (gfx::IsHighDPIEnabled()) {
    scale = gfx::Display::HasForceDeviceScaleFactor() ?
        gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale();
    // Quantize to nearest supported scale factor.
    scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale));
  }
  gfx::InitDeviceScaleFactor(scale);
}

}  // namespace win
}  // namespace ui

Correct bug in InitDeviceScaleFactor - hidden variable.
Correct bug in InitDeviceScaleFactor - hidden variable.

Bug was introduced during refactor in r225722

BUG=306268

Review URL: https://codereview.chromium.org/26444010

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228107 0039d316-1c4b-4281-b951-d872f2087c98
