| # 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. | |
| import("//build/config/jumbo.gni") | |
| import("//build/config/ui.gni") | |
| import("//gpu/vulkan/features.gni") | |
| import("//testing/test.gni") | |
| if (is_mac) { | |
| import("//build/config/mac/mac_sdk.gni") | |
| } | |
| declare_args() { | |
| subpixel_font_rendering_disabled = false | |
| } | |
| jumbo_component("service") { | |
| output_name = "gpu_ipc_service" | |
| sources = [ | |
| "command_buffer_stub.cc", | |
| "command_buffer_stub.h", | |
| "context_url.cc", | |
| "context_url.h", | |
| "display_context.h", | |
| "gles2_command_buffer_stub.cc", | |
| "gles2_command_buffer_stub.h", | |
| "gpu_channel.cc", | |
| "gpu_channel.h", | |
| "gpu_channel_manager.cc", | |
| "gpu_channel_manager.h", | |
| "gpu_channel_manager_delegate.h", | |
| "gpu_config.h", | |
| "gpu_init.cc", | |
| "gpu_init.h", | |
| "gpu_memory_buffer_factory.cc", | |
| "gpu_memory_buffer_factory.h", | |
| "gpu_watchdog_thread.cc", | |
| "gpu_watchdog_thread.h", | |
| "gpu_watchdog_thread_v2.cc", | |
| "gpu_watchdog_thread_v2.h", | |
| "image_decode_accelerator_stub.cc", | |
| "image_decode_accelerator_stub.h", | |
| "image_decode_accelerator_worker.h", | |
| "image_transport_surface.h", | |
| "image_transport_surface_delegate.h", | |
| "pass_through_image_transport_surface.cc", | |
| "pass_through_image_transport_surface.h", | |
| "raster_command_buffer_stub.cc", | |
| "raster_command_buffer_stub.h", | |
| "shared_image_stub.cc", | |
| "shared_image_stub.h", | |
| "webgpu_command_buffer_stub.cc", | |
| "webgpu_command_buffer_stub.h", | |
| ] | |
| defines = [ "GPU_IPC_SERVICE_IMPLEMENTATION" ] | |
| if (is_chromecast) { | |
| defines += [ "IS_CHROMECAST" ] | |
| } | |
| if (subpixel_font_rendering_disabled) { | |
| defines += [ "SUBPIXEL_FONT_RENDERING_DISABLED" ] | |
| } | |
| public_deps = [ | |
| "//base", | |
| "//components/viz/common", | |
| "//gpu/config", | |
| "//ipc", | |
| "//ui/base", | |
| "//ui/display", | |
| "//ui/gfx", | |
| "//ui/gfx/geometry", | |
| "//ui/gl", | |
| "//ui/gl:buildflags", | |
| "//ui/gl/init", | |
| "//url", | |
| ] | |
| deps = [ | |
| "//base/third_party/dynamic_annotations", | |
| # crbug.com/799267: crash_key needs to be added explicitly for Windows and | |
| # Mac even though it's not directly referenced, because it's being | |
| # implicitly depended upon by gpu/config/gpu_crash_keys.h but deps (even | |
| # public ones) are not transitive for static libraries. | |
| "//components/crash/core/common:crash_key", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/service", | |
| "//gpu/command_buffer/service:gles2", | |
| "//gpu/config", | |
| "//gpu/ipc/common", | |
| "//gpu/vulkan:buildflags", | |
| ] | |
| libs = [] | |
| ldflags = [] | |
| if (is_win) { | |
| sources += [ | |
| "gpu_memory_buffer_factory_dxgi.cc", | |
| "gpu_memory_buffer_factory_dxgi.h", | |
| "image_transport_surface_win.cc", | |
| ] | |
| } | |
| if (is_mac) { | |
| sources += [ | |
| "gpu_memory_buffer_factory_io_surface.cc", | |
| "gpu_memory_buffer_factory_io_surface.h", | |
| "image_transport_surface_mac.mm", | |
| "image_transport_surface_overlay_mac.h", | |
| "image_transport_surface_overlay_mac.mm", | |
| ] | |
| deps += [ "//ui/accelerated_widget_mac" ] | |
| lib_dirs = [ "$mac_sdk_path/usr/lib" ] | |
| libs += [ | |
| "CoreGraphics.framework", | |
| "IOSurface.framework", | |
| "OpenGL.framework", | |
| "QuartzCore.framework", | |
| ] | |
| } | |
| if (is_android) { | |
| sources += [ | |
| "gpu_memory_buffer_factory_android_hardware_buffer.cc", | |
| "gpu_memory_buffer_factory_android_hardware_buffer.h", | |
| "image_transport_surface_android.cc", | |
| "stream_texture_android.cc", | |
| "stream_texture_android.h", | |
| ] | |
| libs += [ "android" ] | |
| } | |
| if (is_linux) { | |
| sources += [ "image_transport_surface_linux.cc" ] | |
| } | |
| if (is_linux || use_ozone) { | |
| sources += [ | |
| "gpu_memory_buffer_factory_native_pixmap.cc", | |
| "gpu_memory_buffer_factory_native_pixmap.h", | |
| ] | |
| } | |
| if (use_x11) { | |
| sources += [ "x_util.h" ] | |
| libs += [ "X11" ] | |
| } | |
| if (use_ozone) { | |
| deps += [ "//ui/ozone" ] | |
| } | |
| if (is_fuchsia) { | |
| sources += [ "image_transport_surface_fuchsia.cc" ] | |
| } | |
| if (enable_vulkan) { | |
| deps += [ "//gpu/vulkan/init" ] | |
| } | |
| } | |
| source_set("test_support") { | |
| testonly = true | |
| sources = [ | |
| "gpu_memory_buffer_factory_test_template.h", | |
| ] | |
| public_deps = [ | |
| ":service", | |
| "//testing/gtest:gtest", | |
| ] | |
| deps = [ | |
| "//base/test:test_support", | |
| "//gpu/ipc/common", | |
| "//ui/gl:test_support", | |
| ] | |
| } |