blob: 2f07492b8c300f0dea90b3ca8b54b42c9c637b62 [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
visibility = [ "//ui/ozone/*" ]
import("//build/config/linux/pkg_config.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//ui/ozone/platform/wayland/wayland.gni")
pkg_config("wayland-egl") {
packages = [ "wayland-egl" ]
}
source_set("wayland") {
sources = [
"client_native_pixmap_factory_wayland.cc",
"client_native_pixmap_factory_wayland.h",
"common/wayland_object.cc",
"common/wayland_object.h",
"common/wayland_util.cc",
"common/wayland_util.h",
"gpu/drm_render_node_path_finder.cc",
"gpu/drm_render_node_path_finder.h",
"gpu/gl_surface_wayland.cc",
"gpu/gl_surface_wayland.h",
"gpu/wayland_buffer_manager_gpu.cc",
"gpu/wayland_buffer_manager_gpu.h",
"gpu/wayland_canvas_surface.cc",
"gpu/wayland_canvas_surface.h",
"gpu/wayland_surface_factory.cc",
"gpu/wayland_surface_factory.h",
"gpu/wayland_surface_gpu.h",
"host/gtk_primary_selection_device.cc",
"host/gtk_primary_selection_device.h",
"host/gtk_primary_selection_device_manager.cc",
"host/gtk_primary_selection_device_manager.h",
"host/gtk_primary_selection_offer.cc",
"host/gtk_primary_selection_offer.h",
"host/gtk_primary_selection_source.cc",
"host/gtk_primary_selection_source.h",
"host/internal/wayland_data_device_base.cc",
"host/internal/wayland_data_device_base.h",
"host/internal/wayland_data_offer_base.cc",
"host/internal/wayland_data_offer_base.h",
"host/internal/wayland_data_source_base.cc",
"host/internal/wayland_data_source_base.h",
"host/wayland_buffer_manager_connector.cc",
"host/wayland_buffer_manager_connector.h",
"host/wayland_buffer_manager_host.cc",
"host/wayland_buffer_manager_host.h",
"host/wayland_clipboard.cc",
"host/wayland_clipboard.h",
"host/wayland_connection.cc",
"host/wayland_connection.h",
"host/wayland_cursor.cc",
"host/wayland_cursor.h",
"host/wayland_cursor_position.cc",
"host/wayland_cursor_position.h",
"host/wayland_data_device.cc",
"host/wayland_data_device.h",
"host/wayland_data_device_manager.cc",
"host/wayland_data_device_manager.h",
"host/wayland_data_offer.cc",
"host/wayland_data_offer.h",
"host/wayland_data_source.cc",
"host/wayland_data_source.h",
"host/wayland_drm.cc",
"host/wayland_drm.h",
"host/wayland_input_method_context.cc",
"host/wayland_input_method_context.h",
"host/wayland_input_method_context_factory.cc",
"host/wayland_input_method_context_factory.h",
"host/wayland_keyboard.cc",
"host/wayland_keyboard.h",
"host/wayland_output.cc",
"host/wayland_output.h",
"host/wayland_output_manager.cc",
"host/wayland_output_manager.h",
"host/wayland_pointer.cc",
"host/wayland_pointer.h",
"host/wayland_screen.cc",
"host/wayland_screen.h",
"host/wayland_shm.cc",
"host/wayland_shm.h",
"host/wayland_shm_buffer.cc",
"host/wayland_shm_buffer.h",
"host/wayland_touch.cc",
"host/wayland_touch.h",
"host/wayland_window.cc",
"host/wayland_window.h",
"host/wayland_window_manager.cc",
"host/wayland_window_manager.h",
"host/wayland_window_observer.cc",
"host/wayland_window_observer.h",
"host/wayland_zwp_linux_dmabuf.cc",
"host/wayland_zwp_linux_dmabuf.h",
"host/xdg_popup_wrapper.h",
"host/xdg_popup_wrapper_v5.cc",
"host/xdg_popup_wrapper_v5.h",
"host/xdg_popup_wrapper_v6.cc",
"host/xdg_popup_wrapper_v6.h",
"host/xdg_surface_wrapper.cc",
"host/xdg_surface_wrapper.h",
"host/xdg_surface_wrapper_v5.cc",
"host/xdg_surface_wrapper_v5.h",
"host/xdg_surface_wrapper_v6.cc",
"host/xdg_surface_wrapper_v6.h",
"host/zwp_text_input_wrapper.h",
"host/zwp_text_input_wrapper_v1.cc",
"host/zwp_text_input_wrapper_v1.h",
"ozone_platform_wayland.cc",
"ozone_platform_wayland.h",
]
import("//ui/base/ui_features.gni")
if (use_xkbcommon) {
configs += [ "//ui/events/ozone:xkbcommon" ]
}
deps = [
"//base",
"//build/config/linux/libdrm",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:gtk_primary_selection_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:wayland_drm_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
"//ui/base",
"//ui/base:buildflags",
"//ui/base/ime/linux",
"//ui/events",
"//ui/events:dom_keycode_converter",
"//ui/events/keycodes:xkb",
"//ui/events/ozone:events_ozone",
"//ui/events/ozone:events_ozone_evdev",
"//ui/events/ozone:events_ozone_layout",
"//ui/events/platform",
"//ui/gfx",
"//ui/gfx:memory_buffer",
"//ui/gfx/geometry",
"//ui/ozone:ozone_base",
"//ui/ozone/common",
"//ui/ozone/common/linux:drm",
"//ui/ozone/public/mojom/wayland:wayland_mojom",
"//ui/platform_window",
"//ui/platform_window/platform_window_handler",
]
if (is_linux && !is_chromeos) {
deps += [ "//ui/base/ime/linux" ]
}
defines = [ "OZONE_IMPLEMENTATION" ]
if (use_wayland_gbm) {
defines += [ "WAYLAND_GBM" ]
sources += [
"gpu/drm_render_node_handle.cc",
"gpu/drm_render_node_handle.h",
"gpu/gbm_pixmap_wayland.cc",
"gpu/gbm_pixmap_wayland.h",
"gpu/gbm_surfaceless_wayland.cc",
"gpu/gbm_surfaceless_wayland.h",
]
deps += [
"//third_party/minigbm",
"//ui/gfx:memory_buffer",
"//ui/ozone/common/linux:gbm",
]
}
configs += [
":wayland-egl",
"//third_party/khronos:khronos_headers",
]
}
source_set("test_support") {
testonly = true
sources = [
"test/constants.h",
"test/global_object.cc",
"test/global_object.h",
"test/mock_buffer.cc",
"test/mock_buffer.h",
"test/mock_pointer.cc",
"test/mock_pointer.h",
"test/mock_surface.cc",
"test/mock_surface.h",
"test/mock_wp_presentation.cc",
"test/mock_wp_presentation.h",
"test/mock_xdg_popup.cc",
"test/mock_xdg_popup.h",
"test/mock_xdg_shell.cc",
"test/mock_xdg_shell.h",
"test/mock_xdg_surface.cc",
"test/mock_xdg_surface.h",
"test/mock_zwp_linux_dmabuf.cc",
"test/mock_zwp_linux_dmabuf.h",
"test/mock_zwp_text_input.cc",
"test/mock_zwp_text_input.h",
"test/server_object.cc",
"test/server_object.h",
"test/test_compositor.cc",
"test/test_compositor.h",
"test/test_data_device.cc",
"test/test_data_device.h",
"test/test_data_device_manager.cc",
"test/test_data_device_manager.h",
"test/test_data_offer.cc",
"test/test_data_offer.h",
"test/test_data_source.cc",
"test/test_data_source.h",
"test/test_keyboard.cc",
"test/test_keyboard.h",
"test/test_output.cc",
"test/test_output.h",
"test/test_positioner.cc",
"test/test_positioner.h",
"test/test_region.cc",
"test/test_region.h",
"test/test_seat.cc",
"test/test_seat.h",
"test/test_touch.cc",
"test/test_touch.h",
"test/test_wayland_server_thread.cc",
"test/test_wayland_server_thread.h",
"test/test_zwp_linux_buffer_params.cc",
"test/test_zwp_linux_buffer_params.h",
"test/test_zwp_text_input_manager.cc",
"test/test_zwp_text_input_manager.h",
]
deps = [
"//base:base",
"//ui/ozone:platform",
]
public_deps = [
"//skia",
"//testing/gmock",
"//third_party/wayland:wayland_server",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
"//ui/gfx/geometry:geometry",
]
}
source_set("wayland_unittests") {
testonly = true
assert(use_wayland_gbm)
sources = [
"gpu/wayland_surface_factory_unittest.cc",
"host/wayland_connection_unittest.cc",
"host/wayland_data_device_unittest.cc",
"host/wayland_input_method_context_unittest.cc",
"host/wayland_keyboard_unittest.cc",
"host/wayland_pointer_unittest.cc",
"host/wayland_screen_unittest.cc",
"host/wayland_touch_unittest.cc",
"host/wayland_window_manager_unittests.cc",
"host/wayland_window_unittest.cc",
"test/wayland_test.cc",
"test/wayland_test.h",
"wayland_buffer_manager_unittest.cc",
]
deps = [
":test_support",
":wayland",
"//build/config/linux/libdrm",
"//testing/gmock",
"//testing/gtest",
"//third_party/wayland:wayland_server",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
"//ui/base",
"//ui/base:buildflags",
"//ui/base/ime/linux",
"//ui/events/ozone:events_ozone_layout",
"//ui/ozone:platform",
"//ui/ozone:test_support",
"//ui/ozone/common/linux:drm",
"//ui/ozone/common/linux:gbm",
"//ui/platform_window/platform_window_handler",
]
import("//ui/base/ui_features.gni")
if (use_xkbcommon) {
deps += [ "//ui/events/keycodes:xkb" ]
}
defines = [
"WL_HIDE_DEPRECATED",
"WAYLAND_GBM",
]
}
fuzzer_test("wayland_buffer_fuzzer") {
defines = [ "WL_HIDE_DEPRECATED" ]
sources = [
"fuzzer/wayland_buffer_fuzzer.cc",
]
deps = [
":test_support",
":wayland",
"//base/test:test_support",
"//build/config/linux/libdrm",
"//mojo/core/embedder",
"//mojo/public/cpp/system",
"//ui/gfx:test_support",
"//ui/platform_window:platform_window",
]
}