| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "ui/gfx/buffer_format_util.h" | 76 #include "ui/gfx/buffer_format_util.h" |
| 77 #include "ui/gfx/buffer_types.h" | 77 #include "ui/gfx/buffer_types.h" |
| 78 #include "ui/views/widget/widget.h" | 78 #include "ui/views/widget/widget.h" |
| 79 #include "ui/views/widget/widget_observer.h" | 79 #include "ui/views/widget/widget_observer.h" |
| 80 #include "ui/wm/core/coordinate_conversion.h" | 80 #include "ui/wm/core/coordinate_conversion.h" |
| 81 | 81 |
| 82 #if defined(USE_OZONE) | 82 #if defined(USE_OZONE) |
| 83 #include <drm_fourcc.h> | 83 #include <drm_fourcc.h> |
| 84 #include <linux-dmabuf-unstable-v1-server-protocol.h> | 84 #include <linux-dmabuf-unstable-v1-server-protocol.h> |
| 85 #include <wayland-drm-server-protocol.h> | 85 #include <wayland-drm-server-protocol.h> |
| 86 |
| 87 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 88 #include "ui/aura/env.h" |
| 89 #include "ui/ozone/platform/drm/common/drm_util.h" |
| 86 #endif | 90 #endif |
| 87 | 91 |
| 88 #if BUILDFLAG(USE_XKBCOMMON) | 92 #if BUILDFLAG(USE_XKBCOMMON) |
| 89 #include <xkbcommon/xkbcommon.h> | 93 #include <xkbcommon/xkbcommon.h> |
| 90 #include "ui/events/keycodes/scoped_xkb.h" // nogncheck | 94 #include "ui/events/keycodes/scoped_xkb.h" // nogncheck |
| 91 #endif | 95 #endif |
| 92 | 96 |
| 93 DECLARE_UI_CLASS_PROPERTY_TYPE(wl_resource*); | 97 DECLARE_UI_CLASS_PROPERTY_TYPE(wl_resource*); |
| 94 | 98 |
| 95 namespace exo { | 99 namespace exo { |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 void bind_linux_dmabuf(wl_client* client, | 759 void bind_linux_dmabuf(wl_client* client, |
| 756 void* data, | 760 void* data, |
| 757 uint32_t version, | 761 uint32_t version, |
| 758 uint32_t id) { | 762 uint32_t id) { |
| 759 wl_resource* resource = | 763 wl_resource* resource = |
| 760 wl_resource_create(client, &zwp_linux_dmabuf_v1_interface, 1, id); | 764 wl_resource_create(client, &zwp_linux_dmabuf_v1_interface, 1, id); |
| 761 | 765 |
| 762 wl_resource_set_implementation(resource, &linux_dmabuf_implementation, data, | 766 wl_resource_set_implementation(resource, &linux_dmabuf_implementation, data, |
| 763 nullptr); | 767 nullptr); |
| 764 | 768 |
| 769 #if defined(USE_OZONE) |
| 770 gfx::GpuMemoryBufferAttribVector attrs = aura::Env::GetInstance() |
| 771 ->context_factory() |
| 772 ->GetGpuMemoryBufferManager() |
| 773 ->GetGpuMemoryBufferAttribs(); |
| 774 |
| 775 for (const auto attrib : attrs) |
| 776 zwp_linux_dmabuf_v1_send_format( |
| 777 resource, ui::GetFourCCFormatFromBufferFormat(attrib.format)); |
| 778 #else |
| 765 for (const auto& supported_format : dmabuf_supported_formats) | 779 for (const auto& supported_format : dmabuf_supported_formats) |
| 766 zwp_linux_dmabuf_v1_send_format(resource, supported_format.dmabuf_format); | 780 zwp_linux_dmabuf_v1_send_format(resource, supported_format.dmabuf_format); |
| 781 #endif |
| 767 } | 782 } |
| 768 | 783 |
| 769 #endif | 784 #endif |
| 770 | 785 |
| 771 //////////////////////////////////////////////////////////////////////////////// | 786 //////////////////////////////////////////////////////////////////////////////// |
| 772 // wl_subsurface_interface: | 787 // wl_subsurface_interface: |
| 773 | 788 |
| 774 void subsurface_destroy(wl_client* client, wl_resource* resource) { | 789 void subsurface_destroy(wl_client* client, wl_resource* resource) { |
| 775 wl_resource_destroy(resource); | 790 wl_resource_destroy(resource); |
| 776 } | 791 } |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3926 DCHECK(event_loop); | 3941 DCHECK(event_loop); |
| 3927 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3942 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 3928 } | 3943 } |
| 3929 | 3944 |
| 3930 void Server::Flush() { | 3945 void Server::Flush() { |
| 3931 wl_display_flush_clients(wl_display_.get()); | 3946 wl_display_flush_clients(wl_display_.get()); |
| 3932 } | 3947 } |
| 3933 | 3948 |
| 3934 } // namespace wayland | 3949 } // namespace wayland |
| 3935 } // namespace exo | 3950 } // namespace exo |
| OLD | NEW |