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

Side by Side Diff: ui/aura/demo/demo_main.cc

Issue 1889423002: Move Windows DPI Code from ui/gfx to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO Created 4 years, 8 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
« no previous file with comments | « ui/aura/demo/DEPS ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/icu_util.h" 9 #include "base/i18n/icu_util.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 18 matching lines...) Expand all
29 #include "ui/gfx/canvas.h" 29 #include "ui/gfx/canvas.h"
30 #include "ui/gfx/geometry/rect.h" 30 #include "ui/gfx/geometry/rect.h"
31 #include "ui/gfx/skia_util.h" 31 #include "ui/gfx/skia_util.h"
32 #include "ui/gl/gl_surface.h" 32 #include "ui/gl/gl_surface.h"
33 33
34 #if defined(USE_X11) 34 #if defined(USE_X11)
35 #include "ui/gfx/x/x11_connection.h" // nogncheck 35 #include "ui/gfx/x/x11_connection.h" // nogncheck
36 #endif 36 #endif
37 37
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 #include "ui/gfx/win/dpi.h" 39 #include "ui/display/win/dpi.h"
40 #endif 40 #endif
41 41
42 namespace { 42 namespace {
43 43
44 // Trivial WindowDelegate implementation that draws a colored background. 44 // Trivial WindowDelegate implementation that draws a colored background.
45 class DemoWindowDelegate : public aura::WindowDelegate { 45 class DemoWindowDelegate : public aura::WindowDelegate {
46 public: 46 public:
47 explicit DemoWindowDelegate(SkColor color) : color_(color) {} 47 explicit DemoWindowDelegate(SkColor color) : color_(color) {}
48 48
49 // Overridden from WindowDelegate: 49 // Overridden from WindowDelegate:
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 int DemoMain() { 126 int DemoMain() {
127 #if defined(USE_X11) 127 #if defined(USE_X11)
128 // This demo uses InProcessContextFactory which uses X on a separate Gpu 128 // This demo uses InProcessContextFactory which uses X on a separate Gpu
129 // thread. 129 // thread.
130 gfx::InitializeThreadedX11(); 130 gfx::InitializeThreadedX11();
131 #endif 131 #endif
132 132
133 gfx::GLSurface::InitializeOneOff(); 133 gfx::GLSurface::InitializeOneOff();
134 134
135 #if defined(OS_WIN) 135 #if defined(OS_WIN)
136 gfx::SetDefaultDeviceScaleFactor(1.0f); 136 display::win::SetDefaultDeviceScaleFactor(1.0f);
137 #endif 137 #endif
138 138
139 // The ContextFactory must exist before any Compositors are created. 139 // The ContextFactory must exist before any Compositors are created.
140 bool context_factory_for_test = false; 140 bool context_factory_for_test = false;
141 std::unique_ptr<ui::InProcessContextFactory> context_factory( 141 std::unique_ptr<ui::InProcessContextFactory> context_factory(
142 new ui::InProcessContextFactory(context_factory_for_test, nullptr)); 142 new ui::InProcessContextFactory(context_factory_for_test, nullptr));
143 context_factory->set_use_test_surface(false); 143 context_factory->set_use_test_surface(false);
144 144
145 // Create the message-loop here before creating the root window. 145 // Create the message-loop here before creating the root window.
146 base::MessageLoopForUI message_loop; 146 base::MessageLoopForUI message_loop;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 int main(int argc, char** argv) { 199 int main(int argc, char** argv) {
200 base::CommandLine::Init(argc, argv); 200 base::CommandLine::Init(argc, argv);
201 201
202 // The exit manager is in charge of calling the dtors of singleton objects. 202 // The exit manager is in charge of calling the dtors of singleton objects.
203 base::AtExitManager exit_manager; 203 base::AtExitManager exit_manager;
204 204
205 base::i18n::InitializeICU(); 205 base::i18n::InitializeICU();
206 206
207 return DemoMain(); 207 return DemoMain();
208 } 208 }
OLDNEW
« no previous file with comments | « ui/aura/demo/DEPS ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698