Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: ui/base/win/dpi_setup.cc

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/win/dpi_setup.h ('k') | ui/base/win/foreground_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/win/dpi_setup.h"
6
7 #include "ui/base/layout.h"
8 #include "ui/gfx/display.h"
9 #include "ui/gfx/win/dpi.h"
10
11 namespace ui {
12 namespace win {
13
14 void InitDeviceScaleFactor() {
15 float scale = 1.0f;
16 if (gfx::IsHighDPIEnabled()) {
17 float scale = gfx::Display::HasForceDeviceScaleFactor() ?
18 gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale();
19 // Quantize to nearest supported scale factor.
20 scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale));
21 }
22 gfx::InitDeviceScaleFactor(scale);
23 }
24
25 } // namespace win
26 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/dpi_setup.h ('k') | ui/base/win/foreground_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698