OLD | NEW |
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> |
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 | 2330 |
2331 void bind_remote_shell_DEPRECATED(wl_client* client, | 2331 void bind_remote_shell_DEPRECATED(wl_client* client, |
2332 void* data, | 2332 void* data, |
2333 uint32_t version, | 2333 uint32_t version, |
2334 uint32_t id) { | 2334 uint32_t id) { |
2335 wl_resource* resource = wl_resource_create( | 2335 wl_resource* resource = wl_resource_create( |
2336 client, &zwp_remote_shell_v1_interface, | 2336 client, &zwp_remote_shell_v1_interface, |
2337 std::min(version, remote_shell_version_DEPRECATED), id); | 2337 std::min(version, remote_shell_version_DEPRECATED), id); |
2338 | 2338 |
2339 SetImplementation(resource, &remote_shell_implementation_DEPRECATED, | 2339 SetImplementation(resource, &remote_shell_implementation_DEPRECATED, |
2340 base::MakeUnique<WaylandRemoteShell>( | 2340 base::MakeUnique<WaylandRemoteShell_DEPRECATED>( |
2341 static_cast<Display*>(data), resource)); | 2341 static_cast<Display*>(data), resource)); |
2342 } | 2342 } |
2343 | 2343 |
2344 //////////////////////////////////////////////////////////////////////////////// | 2344 //////////////////////////////////////////////////////////////////////////////// |
2345 // vsync_timing_interface: | 2345 // vsync_timing_interface: |
2346 | 2346 |
2347 // Implements VSync timing interface by monitoring a compositor for updates | 2347 // Implements VSync timing interface by monitoring a compositor for updates |
2348 // to VSync parameters. | 2348 // to VSync parameters. |
2349 class VSyncTiming : public ui::CompositorVSyncManager::Observer { | 2349 class VSyncTiming : public ui::CompositorVSyncManager::Observer { |
2350 public: | 2350 public: |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2537 wl_resource* resource, | 2537 wl_resource* resource, |
2538 uint32_t id, | 2538 uint32_t id, |
2539 wl_resource* output) { | 2539 wl_resource* output) { |
2540 wl_resource* timing_resource = | 2540 wl_resource* timing_resource = |
2541 wl_resource_create(client, &zwp_vsync_timing_v1_interface, 1, id); | 2541 wl_resource_create(client, &zwp_vsync_timing_v1_interface, 1, id); |
2542 | 2542 |
2543 // TODO(reveman): Multi-display support. | 2543 // TODO(reveman): Multi-display support. |
2544 ui::Compositor* compositor = | 2544 ui::Compositor* compositor = |
2545 ash::Shell::GetPrimaryRootWindow()->layer()->GetCompositor(); | 2545 ash::Shell::GetPrimaryRootWindow()->layer()->GetCompositor(); |
2546 | 2546 |
2547 SetImplementation(timing_resource, &vsync_timing_implementation_DEPRECATED, | 2547 SetImplementation( |
2548 VSyncTiming::Create(compositor, timing_resource)); | 2548 timing_resource, &vsync_timing_implementation_DEPRECATED, |
| 2549 VSyncTiming_DEPRECATED::Create(compositor, timing_resource)); |
2549 } | 2550 } |
2550 | 2551 |
2551 const struct zwp_vsync_feedback_v1_interface | 2552 const struct zwp_vsync_feedback_v1_interface |
2552 vsync_feedback_implementation_DEPRECATED = { | 2553 vsync_feedback_implementation_DEPRECATED = { |
2553 vsync_feedback_destroy_DEPRECATED, | 2554 vsync_feedback_destroy_DEPRECATED, |
2554 vsync_feedback_get_vsync_timing_DEPRECATED}; | 2555 vsync_feedback_get_vsync_timing_DEPRECATED}; |
2555 | 2556 |
2556 void bind_vsync_feedback_DEPRECATED(wl_client* client, | 2557 void bind_vsync_feedback_DEPRECATED(wl_client* client, |
2557 void* data, | 2558 void* data, |
2558 uint32_t version, | 2559 uint32_t version, |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3973 DCHECK(event_loop); | 3974 DCHECK(event_loop); |
3974 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3975 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
3975 } | 3976 } |
3976 | 3977 |
3977 void Server::Flush() { | 3978 void Server::Flush() { |
3978 wl_display_flush_clients(wl_display_.get()); | 3979 wl_display_flush_clients(wl_display_.get()); |
3979 } | 3980 } |
3980 | 3981 |
3981 } // namespace wayland | 3982 } // namespace wayland |
3982 } // namespace exo | 3983 } // namespace exo |
OLD | NEW |