| # Copyright 2013 The Chromium Authors | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import("//build/config/ozone.gni") | |
| import("//skia/features.gni") | |
| import("//ui/gl/features.gni") | |
| declare_args() { | |
| # Enable GPU client logging without DCHECK being on. | |
| enable_gpu_client_logging = false | |
| } | |
| config("implementation") { | |
| defines = [ "GPU_COMMAND_BUFFER_CLIENT_IMPLEMENTATION" ] | |
| } | |
| # The files here go into the "gpu" component in a component build (with | |
| # "command_buffer_client" and "gles2_cmd_helper" just forwarding) and goes into | |
| # separate static libraries in non-component build. | |
| component("client") { | |
| public_deps = [ ":client_sources" ] | |
| } | |
| group("gles2_cmd_helper") { | |
| if (is_component_build) { | |
| public_deps = [ "//gpu:gles2" ] | |
| } else { | |
| public_deps = [ ":gles2_cmd_helper_sources" ] | |
| } | |
| } | |
| group("raster") { | |
| if (is_component_build) { | |
| public_deps = [ "//gpu:raster" ] | |
| } else { | |
| public_deps = [ ":raster_sources" ] | |
| } | |
| } | |
| group("webgpu") { | |
| if (is_component_build) { | |
| public_deps = [ "//gpu:webgpu" ] | |
| } else { | |
| public_deps = [ ":webgpu_sources" ] | |
| } | |
| } | |
| source_set("export") { | |
| sources = [ "gpu_command_buffer_client_export.h" ] | |
| } | |
| source_set("client_sources") { | |
| # External code should depend on this via //gpu/client above rather than | |
| # depending on this directly or the component build will break. | |
| visibility = [ ":client" ] | |
| sources = [ | |
| "client_discardable_manager.cc", | |
| "client_discardable_manager.h", | |
| "client_shared_image.cc", | |
| "client_shared_image.h", | |
| "cmd_buffer_helper.cc", | |
| "cmd_buffer_helper.h", | |
| "fenced_allocator.cc", | |
| "fenced_allocator.h", | |
| "gpu_control.h", | |
| "mapped_memory.cc", | |
| "mapped_memory.h", | |
| "ring_buffer.cc", | |
| "ring_buffer.h", | |
| "shared_image_interface.cc", | |
| "shared_image_interface.h", | |
| "shared_image_pool.cc", | |
| "shared_image_pool.h", | |
| "transfer_buffer.cc", | |
| "transfer_buffer.h", | |
| "transfer_buffer_cmd_copy_helpers.h", | |
| ] | |
| configs += [ ":implementation" ] | |
| all_dependent_configs = [ "//gpu:gl_headers" ] | |
| public_deps = [ | |
| "//base", | |
| "//components/viz/common/resources:shared_image_format", | |
| "//skia", | |
| ] | |
| deps = [ | |
| ":export", | |
| ":gles2_interface", | |
| ":webgpu_interface", | |
| "//gpu/command_buffer/client/internal", | |
| "//gpu/command_buffer/common", | |
| "//gpu/ipc/common", | |
| "//gpu/ipc/common:surface_handle_type", | |
| "//skia:buildflags", | |
| "//third_party/dawn/include/dawn:cpp_headers_gen", | |
| "//third_party/dawn/src/dawn/wire", | |
| "//ui/gfx:memory_buffer", | |
| "//ui/gfx/geometry", | |
| ] | |
| if (use_ozone) { | |
| deps += [ "//ui/ozone" ] | |
| } | |
| } | |
| source_set("gles2_cmd_helper_sources") { | |
| visibility = [ "//gpu/*" ] | |
| sources = [ | |
| "gles2_cmd_helper.cc", | |
| "gles2_cmd_helper.h", | |
| "gles2_cmd_helper_autogen.h", | |
| ] | |
| configs += [ "//gpu:gpu_gles2_implementation" ] | |
| deps = [ | |
| ":client", | |
| "//base", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/common:gles2_sources", | |
| ] | |
| } | |
| gles2_c_lib_source_files = [ | |
| "gles2_c_lib.cc", | |
| "gles2_c_lib_autogen.h", | |
| "gles2_c_lib_export.h", | |
| "gles2_lib.cc", | |
| "gles2_lib.h", | |
| ] | |
| gles2_implementation_source_files = [ | |
| "buffer_tracker.cc", | |
| "buffer_tracker.h", | |
| "client_context_state.cc", | |
| "client_context_state.h", | |
| "client_context_state_autogen.h", | |
| "client_context_state_impl_autogen.h", | |
| "client_transfer_cache.cc", | |
| "client_transfer_cache.h", | |
| "gles2_impl_export.h", | |
| "gles2_implementation.cc", | |
| "gles2_implementation.h", | |
| "gles2_implementation_autogen.h", | |
| "gles2_implementation_impl_autogen.h", | |
| "gles2_trace_implementation.cc", | |
| "gles2_trace_implementation.h", | |
| "gles2_trace_implementation_autogen.h", | |
| "gles2_trace_implementation_impl_autogen.h", | |
| "gpu_switches.cc", | |
| "gpu_switches.h", | |
| "implementation_base.cc", | |
| "implementation_base.h", | |
| "logging.cc", | |
| "logging.h", | |
| "program_info_manager.cc", | |
| "program_info_manager.h", | |
| "query_tracker.cc", | |
| "query_tracker.h", | |
| "readback_buffer_shadow_tracker.cc", | |
| "readback_buffer_shadow_tracker.h", | |
| "share_group.cc", | |
| "share_group.h", | |
| "vertex_array_object_manager.cc", | |
| "vertex_array_object_manager.h", | |
| ] | |
| source_set("interface_base") { | |
| sources = [ "interface_base.h" ] | |
| public_configs = [ "//gpu:gl_headers" ] | |
| deps = [ "//base" ] | |
| } | |
| # Provides GLES2 interface, but does not cause any implementation to be linked | |
| # in. Useful when a target uses the interface, but permits its users to choose | |
| # an implementation. | |
| source_set("gles2_interface") { | |
| sources = [ | |
| "gles2_interface.cc", | |
| "gles2_interface.h", | |
| "gles2_interface_stub.cc", | |
| "gles2_interface_stub.h", | |
| "gles2_interface_stub_autogen.h", | |
| "gles2_interface_stub_impl_autogen.h", | |
| ] | |
| public_configs = [ "//gpu:gl_headers" ] | |
| public_deps = [ | |
| "//gpu/command_buffer/common", | |
| "//skia", | |
| ] | |
| deps = [ | |
| ":interface_base", | |
| "//base", | |
| "//components/viz/common/resources:shared_image_format", | |
| ] | |
| } | |
| source_set("raster_interface") { | |
| sources = [ | |
| "raster_interface.cc", | |
| "raster_interface.h", | |
| "raster_interface_autogen.h", | |
| ] | |
| public_configs = [ "//gpu:gl_headers" ] | |
| deps = [ | |
| ":client", | |
| ":interface_base", | |
| "//base", | |
| "//cc/paint", | |
| "//components/viz/common/resources:shared_image_format", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/common:raster", | |
| "//skia", | |
| "//ui/gfx:buffer_types", | |
| "//ui/gfx/geometry", | |
| ] | |
| } | |
| source_set("webgpu_interface") { | |
| sources = [ | |
| "webgpu_interface.h", | |
| "webgpu_interface_autogen.h", | |
| ] | |
| public_configs = [ "//gpu:gl_headers" ] | |
| deps = [ | |
| ":interface_base", | |
| "//base", | |
| "//gpu/command_buffer/common:webgpu", | |
| "//third_party/blink/public/common/tokens:tokens_headers", | |
| ] | |
| } | |
| # Library emulates GLES2 using command_buffers. | |
| component("gles2_implementation") { | |
| sources = gles2_implementation_source_files | |
| defines = [ "GLES2_IMPL_IMPLEMENTATION" ] | |
| if (enable_gpu_client_logging) { | |
| defines += [ "GPU_ENABLE_CLIENT_LOGGING" ] | |
| } | |
| all_dependent_configs = [ "//gpu:gl_headers" ] | |
| deps = [ | |
| ":client", | |
| ":gles2_cmd_helper", | |
| ":gles2_interface", | |
| "//base", | |
| "//components/viz/common/resources:shared_image_format", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/common:gles2", | |
| "//gpu/command_buffer/common:gles2_utils", | |
| "//ui/gfx:color_space", | |
| "//ui/gfx/geometry", | |
| ] | |
| } | |
| source_set("raster_sources") { | |
| # External code should depend on this via //gpu:raster above rather than | |
| # depending on this directly or the component build will break. | |
| visibility = [ "//gpu/*" ] | |
| all_dependent_configs = [ "//gpu:gl_headers" ] | |
| configs += [ "//gpu:raster_implementation" ] | |
| deps = [ | |
| ":client", | |
| ":gles2_implementation", | |
| ":gles2_interface", | |
| "//base", | |
| "//cc/paint", | |
| "//components/viz/common/resources:shared_image_format", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/common:gles2", | |
| "//gpu/command_buffer/common:gles2_utils", | |
| "//gpu/command_buffer/common:raster", | |
| "//ui/base:features", | |
| "//ui/gfx:color_space", | |
| "//ui/gfx/geometry", | |
| ] | |
| public_deps = [ ":raster_interface" ] | |
| sources = [ | |
| "client_font_manager.cc", | |
| "client_font_manager.h", | |
| "raster_cmd_helper.cc", | |
| "raster_cmd_helper.h", | |
| "raster_cmd_helper_autogen.h", | |
| "raster_implementation.cc", | |
| "raster_implementation.h", | |
| "raster_implementation_autogen.h", | |
| "raster_implementation_impl_autogen.h", | |
| ] | |
| } | |
| source_set("webgpu_sources") { | |
| visibility = [ "//gpu/*" ] | |
| configs += [ "//gpu:webgpu_implementation" ] | |
| deps = [ | |
| ":client", | |
| ":gles2_implementation", | |
| ":webgpu_interface", | |
| "//gpu/command_buffer/common:webgpu", | |
| "//gpu/config", | |
| ] | |
| public_deps = [ "//third_party/dawn/include/dawn:headers" ] | |
| sources = [ | |
| "webgpu_cmd_helper.cc", | |
| "webgpu_cmd_helper.h", | |
| "webgpu_cmd_helper_autogen.h", | |
| "webgpu_export.h", | |
| "webgpu_implementation.cc", | |
| "webgpu_implementation.h", | |
| "webgpu_implementation_autogen.h", | |
| "webgpu_implementation_impl_autogen.h", | |
| ] | |
| if (use_dawn) { | |
| sources += [ | |
| "dawn_client_memory_transfer_service.cc", | |
| "dawn_client_memory_transfer_service.h", | |
| "dawn_client_serializer.cc", | |
| "dawn_client_serializer.h", | |
| "dawn_wire_client.cc", | |
| "dawn_wire_client.h", | |
| ] | |
| } | |
| } | |
| # Library emulates GLES2 using command_buffers. | |
| component("gles2_implementation_no_check") { | |
| sources = gles2_implementation_source_files | |
| defines = [ "GLES2_IMPL_IMPLEMENTATION" ] | |
| if (enable_gpu_client_logging) { | |
| defines += [ "GPU_ENABLE_CLIENT_LOGGING" ] | |
| } | |
| deps = [ | |
| ":client", | |
| ":gles2_cmd_helper", | |
| ":gles2_interface", | |
| "//base", | |
| "//cc/paint", | |
| "//gpu/command_buffer/common", | |
| "//gpu/command_buffer/common:gles2", | |
| "//gpu/command_buffer/common:gles2_utils", | |
| "//ui/gfx", | |
| "//ui/gfx:color_space", | |
| "//ui/gfx/geometry", | |
| ] | |
| } | |
| component("gles2_c_lib") { | |
| sources = gles2_c_lib_source_files | |
| defines = [ "GLES2_C_LIB_IMPLEMENTATION" ] | |
| deps = [ | |
| ":gles2_interface", | |
| "//base", | |
| "//gpu/command_buffer/common", | |
| ] | |
| } |