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 <alpha-compositing-unstable-v1-server-protocol.h> | 7 #include <alpha-compositing-unstable-v1-server-protocol.h> |
8 #include <gaming-input-unstable-v1-server-protocol.h> | 8 #include <gaming-input-unstable-v1-server-protocol.h> |
9 #include <gaming-input-unstable-v2-server-protocol.h> | 9 #include <gaming-input-unstable-v2-server-protocol.h> |
10 #include <grp.h> | 10 #include <grp.h> |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 //////////////////////////////////////////////////////////////////////////////// | 438 //////////////////////////////////////////////////////////////////////////////// |
439 // wl_shm_interface: | 439 // wl_shm_interface: |
440 | 440 |
441 void shm_create_pool(wl_client* client, | 441 void shm_create_pool(wl_client* client, |
442 wl_resource* resource, | 442 wl_resource* resource, |
443 uint32_t id, | 443 uint32_t id, |
444 int fd, | 444 int fd, |
445 int32_t size) { | 445 int32_t size) { |
446 std::unique_ptr<SharedMemory> shared_memory = | 446 std::unique_ptr<SharedMemory> shared_memory = |
447 GetUserDataAs<Display>(resource)->CreateSharedMemory( | 447 GetUserDataAs<Display>(resource)->CreateSharedMemory( |
448 base::SharedMemoryHandle::ImportHandle(fd), size); | 448 base::SharedMemoryHandle::ImportHandle(fd, size), size); |
449 if (!shared_memory) { | 449 if (!shared_memory) { |
450 wl_resource_post_no_memory(resource); | 450 wl_resource_post_no_memory(resource); |
451 return; | 451 return; |
452 } | 452 } |
453 | 453 |
454 wl_resource* shm_pool_resource = | 454 wl_resource* shm_pool_resource = |
455 wl_resource_create(client, &wl_shm_pool_interface, 1, id); | 455 wl_resource_create(client, &wl_shm_pool_interface, 1, id); |
456 | 456 |
457 SetImplementation(shm_pool_resource, &shm_pool_implementation, | 457 SetImplementation(shm_pool_resource, &shm_pool_implementation, |
458 std::move(shared_memory)); | 458 std::move(shared_memory)); |
(...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3955 DCHECK(event_loop); | 3955 DCHECK(event_loop); |
3956 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3956 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
3957 } | 3957 } |
3958 | 3958 |
3959 void Server::Flush() { | 3959 void Server::Flush() { |
3960 wl_display_flush_clients(wl_display_.get()); | 3960 wl_display_flush_clients(wl_display_.get()); |
3961 } | 3961 } |
3962 | 3962 |
3963 } // namespace wayland | 3963 } // namespace wayland |
3964 } // namespace exo | 3964 } // namespace exo |
OLD | NEW |