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

Side by Side Diff: components/exo/wayland/server.cc

Issue 2270553002: Move ash::DisplayInfo to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 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 | « components/exo/pointer.cc ('k') | components/exo/wm_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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/wayland/server.h" 5 #include "components/exo/wayland/server.h"
6 6
7 #include <grp.h> 7 #include <grp.h>
8 #include <linux/input.h> 8 #include <linux/input.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 #include <viewporter-server-protocol.h> 11 #include <viewporter-server-protocol.h>
12 #include <wayland-server-core.h> 12 #include <wayland-server-core.h>
13 #include <wayland-server-protocol-core.h> 13 #include <wayland-server-protocol-core.h>
14 14
15 // Note: core wayland headers need to be included before protocol headers. 15 // Note: core wayland headers need to be included before protocol headers.
16 #include <alpha-compositing-unstable-v1-server-protocol.h> // NOLINT 16 #include <alpha-compositing-unstable-v1-server-protocol.h> // NOLINT
17 #include <gaming-input-unstable-v1-server-protocol.h> // NOLINT 17 #include <gaming-input-unstable-v1-server-protocol.h> // NOLINT
18 #include <remote-shell-unstable-v1-server-protocol.h> // NOLINT 18 #include <remote-shell-unstable-v1-server-protocol.h> // NOLINT
19 #include <secure-output-unstable-v1-server-protocol.h> // NOLINT 19 #include <secure-output-unstable-v1-server-protocol.h> // NOLINT
20 #include <stylus-unstable-v1-server-protocol.h> // NOLINT 20 #include <stylus-unstable-v1-server-protocol.h> // NOLINT
21 #include <xdg-shell-unstable-v5-server-protocol.h> // NOLINT 21 #include <xdg-shell-unstable-v5-server-protocol.h> // NOLINT
22 #include <vsync-feedback-unstable-v1-server-protocol.h> // NOLINT 22 #include <vsync-feedback-unstable-v1-server-protocol.h> // NOLINT
23 23
24 #include <algorithm> 24 #include <algorithm>
25 #include <cstdlib> 25 #include <cstdlib>
26 #include <iterator> 26 #include <iterator>
27 #include <string> 27 #include <string>
28 #include <utility> 28 #include <utility>
29 29
30 #include "ash/common/display/display_info.h"
31 #include "ash/common/shell_observer.h" 30 #include "ash/common/shell_observer.h"
32 #include "ash/common/shell_window_ids.h" 31 #include "ash/common/shell_window_ids.h"
33 #include "ash/shell.h" 32 #include "ash/shell.h"
34 #include "base/bind.h" 33 #include "base/bind.h"
35 #include "base/cancelable_callback.h" 34 #include "base/cancelable_callback.h"
36 #include "base/files/file_path.h" 35 #include "base/files/file_path.h"
37 #include "base/macros.h" 36 #include "base/macros.h"
38 #include "base/memory/free_deleter.h" 37 #include "base/memory/free_deleter.h"
39 #include "base/memory/ptr_util.h" 38 #include "base/memory/ptr_util.h"
40 #include "base/memory/weak_ptr.h" 39 #include "base/memory/weak_ptr.h"
(...skipping 19 matching lines...) Expand all
60 #include "components/exo/surface_property.h" 59 #include "components/exo/surface_property.h"
61 #include "components/exo/touch.h" 60 #include "components/exo/touch.h"
62 #include "components/exo/touch_delegate.h" 61 #include "components/exo/touch_delegate.h"
63 #include "components/exo/wm_helper.h" 62 #include "components/exo/wm_helper.h"
64 #include "ipc/unix_domain_socket_util.h" 63 #include "ipc/unix_domain_socket_util.h"
65 #include "third_party/skia/include/core/SkRegion.h" 64 #include "third_party/skia/include/core/SkRegion.h"
66 #include "ui/aura/window_property.h" 65 #include "ui/aura/window_property.h"
67 #include "ui/base/hit_test.h" 66 #include "ui/base/hit_test.h"
68 #include "ui/compositor/compositor_vsync_manager.h" 67 #include "ui/compositor/compositor_vsync_manager.h"
69 #include "ui/display/display_observer.h" 68 #include "ui/display/display_observer.h"
69 #include "ui/display/manager/managed_display_info.h"
70 #include "ui/display/screen.h" 70 #include "ui/display/screen.h"
71 #include "ui/events/keycodes/dom/keycode_converter.h" 71 #include "ui/events/keycodes/dom/keycode_converter.h"
72 #include "ui/gfx/buffer_format_util.h" 72 #include "ui/gfx/buffer_format_util.h"
73 #include "ui/gfx/buffer_types.h" 73 #include "ui/gfx/buffer_types.h"
74 #include "ui/views/widget/widget.h" 74 #include "ui/views/widget/widget.h"
75 #include "ui/views/widget/widget_observer.h" 75 #include "ui/views/widget/widget_observer.h"
76 76
77 #if defined(USE_OZONE) 77 #if defined(USE_OZONE)
78 #include <drm_fourcc.h> 78 #include <drm_fourcc.h>
79 #include <linux-dmabuf-unstable-v1-server-protocol.h> 79 #include <linux-dmabuf-unstable-v1-server-protocol.h>
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 DISPLAY_METRIC_ROTATION)) { 1067 DISPLAY_METRIC_ROTATION)) {
1068 SendDisplayMetrics(); 1068 SendDisplayMetrics();
1069 } 1069 }
1070 } 1070 }
1071 1071
1072 private: 1072 private:
1073 void SendDisplayMetrics() { 1073 void SendDisplayMetrics() {
1074 display::Display display = 1074 display::Display display =
1075 display::Screen::GetScreen()->GetPrimaryDisplay(); 1075 display::Screen::GetScreen()->GetPrimaryDisplay();
1076 1076
1077 const ash::DisplayInfo& info = 1077 const display::ManagedDisplayInfo& info =
1078 WMHelper::GetInstance()->GetDisplayInfo(display.id()); 1078 WMHelper::GetInstance()->GetDisplayInfo(display.id());
1079 1079
1080 const float kInchInMm = 25.4f; 1080 const float kInchInMm = 25.4f;
1081 const char* kUnknownMake = "unknown"; 1081 const char* kUnknownMake = "unknown";
1082 const char* kUnknownModel = "unknown"; 1082 const char* kUnknownModel = "unknown";
1083 1083
1084 gfx::Rect bounds = info.bounds_in_native(); 1084 gfx::Rect bounds = info.bounds_in_native();
1085 wl_output_send_geometry( 1085 wl_output_send_geometry(
1086 output_resource_, bounds.x(), bounds.y(), 1086 output_resource_, bounds.x(), bounds.y(),
1087 static_cast<int>(kInchInMm * bounds.width() / info.device_dpi()), 1087 static_cast<int>(kInchInMm * bounds.width() / info.device_dpi()),
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 DCHECK(event_loop); 3128 DCHECK(event_loop);
3129 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3129 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3130 } 3130 }
3131 3131
3132 void Server::Flush() { 3132 void Server::Flush() {
3133 wl_display_flush_clients(wl_display_.get()); 3133 wl_display_flush_clients(wl_display_.get());
3134 } 3134 }
3135 3135
3136 } // namespace wayland 3136 } // namespace wayland
3137 } // namespace exo 3137 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/pointer.cc ('k') | components/exo/wm_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698