| # Copyright 2016 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/ui.gni") |
| import("//gpu/vulkan/features.gni") |
| import("//mojo/public/tools/bindings/mojom.gni") |
| |
| if (is_ios) { |
| import("//build/config/apple/mobile_config.gni") # For `target_platform` |
| } |
| |
| group("common") { |
| if (is_component_build) { |
| public_deps = [ "//gpu" ] |
| } else { |
| public_deps = [ ":ipc_common_sources" ] |
| } |
| } |
| |
| group("command_buffer_traits") { |
| if (is_component_build) { |
| public_deps = [ "//gpu" ] |
| } else { |
| public_deps = [ ":command_buffer_traits_sources" ] |
| } |
| } |
| |
| source_set("export") { |
| visibility = [ "//gpu/ipc/common/*" ] |
| sources = [ "gpu_ipc_common_export.h" ] |
| } |
| |
| source_set("command_buffer_traits_sources") { |
| # External code should depend on this via |
| # //gpu/ipc/common:command_buffer_traits above rather than depending on this |
| # directly or the component build will break. |
| visibility = [ "//gpu/*" ] |
| |
| sources = [ |
| "gpu_command_buffer_traits.cc", |
| "gpu_command_buffer_traits.h", |
| "gpu_command_buffer_traits_multi.h", |
| ] |
| |
| configs += [ |
| "//gpu:gpu_implementation", |
| "//third_party/khronos:khronos_headers", |
| ] |
| |
| public_deps = [ |
| ":export", |
| "//gpu/command_buffer/common", |
| "//ipc", |
| "//ui/gfx/ipc", |
| ] |
| |
| deps = [ |
| "//base", |
| "//ui/gfx/ipc/buffer_types", |
| "//ui/gfx/ipc/geometry", |
| "//ui/gfx/ipc/skia", |
| ] |
| } |
| |
| source_set("memory_stats_sources") { |
| sources = [ |
| "memory_stats.cc", |
| "memory_stats.h", |
| ] |
| public_deps = [ |
| ":export", |
| "//base", |
| ] |
| configs += [ "//gpu:gpu_implementation" ] |
| } |
| |
| source_set("gpu_peak_memory") { |
| sources = [ "gpu_peak_memory.h" ] |
| } |
| |
| source_set("ipc_common_sources") { |
| # External code should depend on this via //gpu/ipc/common above rather than |
| # depending on this directly or the component build will break. |
| visibility = [ "//gpu/*" ] |
| |
| sources = [ |
| "command_buffer_id.h", |
| "command_buffer_trace_utils.h", |
| "gpu_client_ids.h", |
| "gpu_disk_cache_type.cc", |
| "gpu_disk_cache_type.h", |
| "gpu_memory_buffer_handle_info.h", |
| "gpu_memory_buffer_support.cc", |
| "gpu_memory_buffer_support.h", |
| "gpu_param_traits.cc", |
| "gpu_param_traits.h", |
| "gpu_param_traits_macros.h", |
| "gpu_watchdog_timeout.h", |
| "result_codes.h", |
| ] |
| |
| if (is_win) { |
| sources += [ |
| "dxgi_helpers.cc", |
| "dxgi_helpers.h", |
| ] |
| libs = [ |
| "d3d11.lib", |
| "dxguid.lib", |
| ] |
| } |
| if (use_ozone) { |
| sources += [ |
| "legacy_gpu_memory_buffer_for_video.cc", |
| "legacy_gpu_memory_buffer_for_video.h", |
| ] |
| } |
| if (is_android) { |
| visibility += [ "//media/gpu" ] |
| } |
| |
| configs += [ |
| "//gpu:gpu_implementation", |
| "//third_party/khronos:khronos_headers", |
| ] |
| |
| public_deps = [ |
| ":command_buffer_traits_sources", |
| ":export", |
| ":gpu_channel_mojom", |
| ":gpu_peak_memory", |
| ":interfaces_cpp_sources", |
| ":memory_stats_sources", |
| ":shared_image_pool_client_interface", |
| ":surface_handle_type", |
| "//ipc", |
| "//url/ipc:url_ipc", |
| ] |
| |
| deps = [ |
| "//base", |
| "//components/viz/common:shared_image_format", |
| "//gpu/command_buffer/common", |
| "//gpu/config", |
| "//third_party/libyuv", |
| "//ui/base", |
| "//ui/gfx:color_space", |
| "//ui/gfx/geometry", |
| "//ui/gfx/ipc", |
| "//ui/gfx/ipc/buffer_types", |
| "//ui/gfx/ipc/color", |
| "//ui/gfx/ipc/geometry", |
| "//ui/gfx/ipc/skia", |
| "//ui/gl", |
| ] |
| |
| if (is_ios && target_platform == "iphoneos") { |
| sources += [ |
| "ios/be_layer_hierarchy_transport.cc", |
| "ios/be_layer_hierarchy_transport.h", |
| ] |
| } |
| |
| if (is_android) { |
| sources += [ |
| "android/android_hardware_buffer_utils.cc", |
| "android/android_hardware_buffer_utils.h", |
| "gpu_surface_lookup.cc", |
| "gpu_surface_lookup.h", |
| "gpu_surface_tracker.cc", |
| "gpu_surface_tracker.h", |
| ] |
| libs = [ "android" ] |
| deps += [ "//ui/gl:surface_jni_headers" ] |
| } |
| |
| if (use_ozone) { |
| deps += [ "//ui/ozone" ] |
| } |
| } |
| |
| # Depend on this to use surface_handle.h without pulling in all of gpu ipc. |
| source_set("surface_handle_type") { |
| public = [ "surface_handle.h" ] |
| |
| public_deps = [ "//ui/gfx:native_widget_types" ] |
| } |
| |
| source_set("vulkan_types") { |
| sources = [ "vulkan_types.h" ] |
| public_deps = [ |
| ":export", |
| "//ui/gfx", |
| ] |
| all_dependent_configs = |
| [ "//third_party/vulkan-headers/src:vulkan_headers_config" ] |
| configs += [ "//gpu:gpu_implementation" ] |
| } |
| |
| mojom("gpu_channel_mojom") { |
| visibility = [ ":ipc_common_sources" ] |
| |
| sources = [ "gpu_channel.mojom" ] |
| |
| public_deps = [ |
| ":shared_image_pool_client_interface", |
| ":surface_handle", |
| "//mojo/public/mojom/base", |
| "//services/viz/public/mojom:shared_image_format", |
| "//skia/public/mojom", |
| "//ui/gfx/geometry/mojom", |
| "//ui/gfx/mojom", |
| "//ui/gl/mojom", |
| "//url/mojom:url_mojom_gurl", |
| ] |
| |
| mojom_source_deps = [ ":interfaces" ] |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.ContextType" |
| cpp = "::gpu::ContextType" |
| }, |
| ] |
| traits_headers = [ "context_creation_attribs_mojom_traits.h" ] |
| traits_public_deps = [ "//gpu/command_buffer/common" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Error" |
| cpp = "::gpu::error::Error" |
| }, |
| { |
| mojom = "gpu.mojom.ContextLostReason" |
| cpp = "::gpu::error::ContextLostReason" |
| }, |
| { |
| mojom = "gpu.mojom.CommandBufferState" |
| cpp = "::gpu::CommandBuffer::State" |
| }, |
| ] |
| traits_headers = [ "command_buffer_mojom_traits.h" ] |
| traits_sources = [ "command_buffer_mojom_traits.cc" ] |
| traits_public_deps = [ "//gpu/command_buffer/common" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SchedulingPriority" |
| cpp = "::gpu::SchedulingPriority" |
| }, |
| ] |
| traits_headers = [ "scheduling_priority_mojom_traits.h" ] |
| traits_public_deps = [ "//gpu/command_buffer/common" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SwapBuffersCompleteParams" |
| cpp = "::gpu::SwapBuffersCompleteParams" |
| }, |
| ] |
| traits_headers = [ "gpu_param_traits_macros.h" ] |
| }, |
| ] |
| |
| # Unlike some definitions in ":interfaces_mojom", these bindings are never |
| # used in Blink. We disable variants to simplify the dependency graph. |
| disable_variants = true |
| |
| export_class_attribute = "GPU_EXPORT" |
| export_header = "gpu/gpu_export.h" |
| cpp_configs = [ "//gpu:gpu_implementation" ] |
| } |
| |
| mojom("shared_image_pool_client_interface") { |
| generate_java = true |
| visibility = [ |
| "//gpu/*", |
| "//services/*", |
| ] |
| sources = [ "shared_image_pool_client_interface.mojom" ] |
| deps = [ "//mojo/public/mojom/base" ] |
| export_class_attribute = "GPU_EXPORT" |
| export_header = "gpu/gpu_export.h" |
| cpp_configs = [ "//gpu:gpu_implementation" ] |
| } |
| |
| mojom("surface_handle") { |
| generate_java = true |
| sources = [ "surface_handle.mojom" ] |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SurfaceHandle" |
| cpp = "::gpu::SurfaceHandle" |
| copyable_pass_by_value = true |
| }, |
| ] |
| traits_headers = [ "surface_handle_mojom_traits.h" ] |
| traits_public_deps = [ "//ui/gfx:native_widget_types" ] |
| }, |
| ] |
| } |
| |
| mojom("interfaces") { |
| generate_java = true |
| sources = [ |
| "capabilities.mojom", |
| "context_result.mojom", |
| "device_perf_info.mojom", |
| "exported_shared_image.mojom", |
| "gpu_disk_cache_type.mojom", |
| "gpu_feature_info.mojom", |
| "gpu_info.mojom", |
| "gpu_peak_memory.mojom", |
| "mailbox.mojom", |
| "mailbox_holder.mojom", |
| "memory_stats.mojom", |
| "shared_image_capabilities.mojom", |
| "shared_image_metadata.mojom", |
| "shared_image_pool_id.mojom", |
| "sync_token.mojom", |
| "vulkan_ycbcr_info.mojom", |
| ] |
| |
| if (is_win) { |
| sources += [ "luid.mojom" ] |
| } |
| |
| public_deps = [ |
| ":gpu_preferences_interface", |
| ":shared_image_pool_client_interface", |
| ":surface_handle", |
| "//mojo/public/mojom/base", |
| "//services/viz/public/mojom:shared_image_format", |
| "//skia/public/mojom", |
| "//ui/gfx/geometry/mojom", |
| "//ui/gfx/mojom", |
| "//ui/gl/mojom", |
| ] |
| enabled_features = [] |
| if (enable_vulkan) { |
| public_deps += [ ":vulkan_interface" ] |
| enabled_features += [ "supports_vulkan" ] |
| } |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Capabilities" |
| cpp = "::gpu::Capabilities" |
| }, |
| ] |
| traits_headers = [ "gpu_command_buffer_traits.h" ] |
| traits_public_deps = [ ":command_buffer_traits_sources" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.GLCapabilities" |
| cpp = "::gpu::GLCapabilities" |
| }, |
| ] |
| traits_headers = [ "gpu_command_buffer_traits.h" ] |
| traits_public_deps = [ ":command_buffer_traits_sources" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.ContextResult" |
| cpp = "::gpu::ContextResult" |
| }, |
| ] |
| traits_headers = [ "context_result_mojom_traits.h" ] |
| traits_public_deps = [ "//gpu/command_buffer/common" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.DevicePerfInfo" |
| cpp = "::gpu::DevicePerfInfo" |
| }, |
| { |
| mojom = "gpu.mojom.HasDiscreteGpu" |
| cpp = "::gpu::HasDiscreteGpu" |
| }, |
| ] |
| traits_sources = [ "device_perf_info_mojom_traits.cc" ] |
| traits_headers = [ "device_perf_info_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.ExportedSharedImage" |
| cpp = "::gpu::ExportedSharedImage" |
| move_only = true |
| }, |
| ] |
| traits_headers = [ "exported_shared_image_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.GpuFeatureStatus" |
| cpp = "::gpu::GpuFeatureStatus" |
| }, |
| { |
| mojom = "gpu.mojom.GpuFeatureInfo" |
| cpp = "::gpu::GpuFeatureInfo" |
| }, |
| ] |
| traits_sources = [ "gpu_feature_info_mojom_traits.cc" ] |
| traits_headers = [ "gpu_feature_info_mojom_traits.h" ] |
| traits_public_deps = [ |
| "//gpu/config", |
| "//ui/gfx/geometry/mojom", |
| ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.GpuDevice" |
| cpp = "::gpu::GPUInfo::GPUDevice" |
| }, |
| { |
| mojom = "gpu.mojom.GpuInfo" |
| cpp = "::gpu::GPUInfo" |
| }, |
| { |
| mojom = "gpu.mojom.VideoCodecProfile" |
| cpp = "::gpu::VideoCodecProfile" |
| }, |
| { |
| mojom = "gpu.mojom.VideoDecodeAcceleratorSupportedProfile" |
| cpp = "::gpu::VideoDecodeAcceleratorSupportedProfile" |
| }, |
| { |
| mojom = "gpu.mojom.VideoDecodeAcceleratorCapabilities" |
| cpp = "::gpu::VideoDecodeAcceleratorCapabilities" |
| }, |
| { |
| mojom = "gpu.mojom.VideoEncodeAcceleratorSupportedProfile" |
| cpp = "::gpu::VideoEncodeAcceleratorSupportedProfile" |
| }, |
| { |
| mojom = "gpu.mojom.ImageDecodeAcceleratorSupportedProfile" |
| cpp = "::gpu::ImageDecodeAcceleratorSupportedProfile" |
| }, |
| ] |
| traits_sources = [ "gpu_info_mojom_traits.cc" ] |
| traits_headers = [ "gpu_info_mojom_traits.h" ] |
| traits_public_deps = [ |
| "//gpu/config", |
| "//ui/gfx/geometry/mojom", |
| ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.GpuPeakMemoryAllocationSource" |
| cpp = "::gpu::GpuPeakMemoryAllocationSource" |
| }, |
| ] |
| traits_headers = [ "gpu_peak_memory_mojom_traits.h" ] |
| traits_public_deps = [ ":gpu_peak_memory" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Mailbox" |
| cpp = "::gpu::Mailbox" |
| }, |
| ] |
| traits_headers = [ "mailbox_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.MailboxHolder" |
| cpp = "::gpu::MailboxHolder" |
| }, |
| ] |
| traits_headers = [ "mailbox_holder_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SharedImageCapabilities" |
| cpp = "::gpu::SharedImageCapabilities" |
| }, |
| ] |
| traits_sources = [ "shared_image_capabilities_mojom_traits.cc" ] |
| traits_headers = [ "shared_image_capabilities_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SharedImageMetadata" |
| cpp = "::gpu::SharedImageMetadata" |
| }, |
| ] |
| traits_headers = [ "shared_image_metadata_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SharedImagePoolId" |
| cpp = "::gpu::SharedImagePoolId" |
| }, |
| ] |
| traits_sources = [ "shared_image_pool_id_mojom_traits.cc" ] |
| traits_headers = [ "shared_image_pool_id_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SyncToken" |
| cpp = "::gpu::SyncToken" |
| }, |
| ] |
| traits_headers = [ "sync_token_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.VideoMemoryProcessStats" |
| cpp = "::gpu::VideoMemoryUsageStats::ProcessStats" |
| }, |
| { |
| mojom = "gpu.mojom.VideoMemoryUsageStats" |
| cpp = "::gpu::VideoMemoryUsageStats" |
| }, |
| ] |
| traits_headers = [ "memory_stats_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.VulkanYCbCrInfo" |
| cpp = "::gpu::VulkanYCbCrInfo" |
| copyable_pass_by_value = true |
| }, |
| ] |
| traits_headers = [ "vulkan_ycbcr_info_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| # Each specific handle is declared here to ensure that nullable is set. |
| { |
| mojom = "gpu.mojom.GpuDiskCacheGlShaderHandle" |
| cpp = "::gpu::GpuDiskCacheGlShaderHandle" |
| nullable_is_same_type = true |
| }, |
| { |
| mojom = "gpu.mojom.GpuDiskCacheDawnWebGPUHandle" |
| cpp = "::gpu::GpuDiskCacheDawnWebGPUHandle" |
| nullable_is_same_type = true |
| }, |
| { |
| mojom = "gpu.mojom.GpuDiskCacheDawnGraphiteHandle" |
| cpp = "::gpu::GpuDiskCacheDawnGraphiteHandle" |
| nullable_is_same_type = true |
| }, |
| |
| # General types that are the ones generally exposed in interfaces. |
| { |
| mojom = "gpu.mojom.GpuDiskCacheHandle" |
| cpp = "::gpu::GpuDiskCacheHandle" |
| nullable_is_same_type = true |
| }, |
| { |
| mojom = "gpu.mojom.GpuDiskCacheType" |
| cpp = "::gpu::GpuDiskCacheType" |
| }, |
| ] |
| traits_sources = [ "gpu_disk_cache_type_mojom_traits.cc" ] |
| traits_headers = [ "gpu_disk_cache_type_mojom_traits.h" ] |
| }, |
| ] |
| |
| if (is_win) { |
| cpp_typemaps += [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.OverlayInfo" |
| cpp = "::gpu::OverlayInfo" |
| }, |
| { |
| mojom = "gpu.mojom.Direct3DFeatureLevel" |
| cpp = "::D3D_FEATURE_LEVEL" |
| }, |
| ] |
| }, |
| ] |
| } |
| |
| blink_cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Mailbox" |
| cpp = "::gpu::Mailbox" |
| }, |
| ] |
| traits_headers = [ "mailbox_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.MailboxHolder" |
| cpp = "::gpu::MailboxHolder" |
| }, |
| ] |
| traits_headers = [ "mailbox_holder_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.ExportedSharedImage" |
| cpp = "::gpu::ExportedSharedImage" |
| move_only = true |
| }, |
| ] |
| traits_headers = [ "exported_shared_image_mojom_traits.h" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SharedImageMetadata" |
| cpp = "::gpu::SharedImageMetadata" |
| }, |
| ] |
| traits_headers = [ "shared_image_metadata_mojom_traits.h" ] |
| traits_public_deps = [ "//services/viz/public/mojom:shared_image_format" ] |
| }, |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.SyncToken" |
| cpp = "::gpu::SyncToken" |
| }, |
| ] |
| traits_headers = [ "sync_token_mojom_traits.h" ] |
| }, |
| ] |
| |
| if (is_win) { |
| cpp_typemaps += [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Luid" |
| cpp = "::CHROME_LUID" |
| }, |
| ] |
| traits_headers = [ "luid_mojom_traits.h" ] |
| traits_sources = [ "luid_mojom_traits.cc" ] |
| traits_public_deps = [ |
| ":mojom_traits", |
| "//gpu/config", |
| ] |
| }, |
| ] |
| blink_cpp_typemaps += [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.Luid" |
| cpp = "::CHROME_LUID" |
| }, |
| ] |
| traits_headers = [ "luid_mojom_traits.h" ] |
| traits_public_deps = [] |
| }, |
| ] |
| } |
| |
| cpp_proxy_target = ":common" |
| export_class_attribute = "GPU_EXPORT" |
| export_header = "gpu/gpu_export.h" |
| cpp_configs = [ "//gpu:gpu_implementation" ] |
| |
| export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" |
| export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" |
| export_header_blink = "third_party/blink/public/platform/web_common.h" |
| |
| # Because we use the export helpers above, our shared C++ sources target will |
| # be a component. This gives it a globally unique library name. |
| component_output_prefix = "gpu_common_interfaces" |
| } |
| |
| mojom("gpu_preferences_interface") { |
| generate_java = true |
| sources = [ "gpu_preferences.mojom" ] |
| |
| public_deps = [ |
| "//mojo/public/mojom/base", |
| "//ui/gfx/mojom", |
| ] |
| |
| enabled_features = [] |
| if (use_ozone) { |
| enabled_features += [ "use_ozone" ] |
| } |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.GpuPreferences" |
| cpp = "::gpu::GpuPreferences" |
| }, |
| ] |
| traits_headers = [ "gpu_preferences_mojom_traits.h" ] |
| traits_public_deps = [ "//media:media_buildflags" ] |
| if (use_ozone) { |
| traits_public_deps += [ "//ui/base:features" ] |
| } |
| traits_deps = [ |
| # We depend on gpu_preferences but since it also depends on its own |
| # mojo bindings, that is handled with an |allowed_circular_includes| |
| # in //gpu/config:gpu_preferences. |
| # "//gpu/config:gpu_preferences", |
| ] |
| }, |
| ] |
| } |
| |
| if (enable_vulkan) { |
| mojom("vulkan_interface") { |
| generate_java = true |
| webui_module_path = "/" |
| generate_legacy_js_bindings = true |
| |
| sources = [ |
| "vulkan_info.mojom", |
| "vulkan_types.mojom", |
| ] |
| |
| public_deps = [ "//mojo/public/mojom/base" ] |
| |
| js_generate_struct_deserializers = true |
| |
| # This imports the |generated_vulkan_type_mappings| definition used below. |
| import("//gpu/ipc/common/generated_vulkan_type_mappings.gni") |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gpu.mojom.VulkanPhysicalDeviceInfo" |
| cpp = "::gpu::VulkanPhysicalDeviceInfo" |
| }, |
| { |
| mojom = "gpu.mojom.VulkanInfo" |
| cpp = "::gpu::VulkanInfo" |
| }, |
| ] |
| traits_headers = [ "vulkan_info_mojom_traits.h" ] |
| }, |
| { |
| types = generated_vulkan_type_mappings |
| traits_sources = [ "vulkan_types_mojom_traits.cc" ] |
| traits_headers = [ "vulkan_types_mojom_traits.h" ] |
| traits_public_deps = [ ":vulkan_types" ] |
| }, |
| ] |
| |
| export_class_attribute = "GPU_EXPORT" |
| export_header = "gpu/gpu_export.h" |
| cpp_configs = [ "//gpu:gpu_implementation" ] |
| } |
| } |
| |
| mojom("test_interfaces") { |
| testonly = true |
| sources = [ "traits_test_service.test-mojom" ] |
| |
| public_deps = [ |
| ":gpu_preferences_interface", |
| ":interfaces", |
| ] |
| |
| if (enable_vulkan) { |
| public_deps += [ ":vulkan_interface" ] |
| } |
| } |
| |
| source_set("mojom_traits") { |
| # External dependents on these traits should depend on //gpu/ipc/common. |
| visibility = [ ":*" ] |
| |
| sources = [ |
| "context_result_mojom_traits.h", |
| "gpu_peak_memory_mojom_traits.h", |
| "mailbox_holder_mojom_traits.h", |
| "mailbox_mojom_traits.cc", |
| "mailbox_mojom_traits.h", |
| "memory_stats_mojom_traits.h", |
| "surface_handle_mojom_traits.h", |
| "sync_token_mojom_traits.h", |
| ] |
| public_deps = [ |
| ":gpu_peak_memory", |
| ":interfaces_shared", |
| ":memory_stats_sources", |
| ":surface_handle_type", |
| "//gpu/command_buffer/common", |
| "//mojo/public/cpp/bindings", |
| ] |
| |
| if (enable_vulkan) { |
| public_deps += [ "//gpu/vulkan" ] |
| } |
| |
| if (is_android) { |
| sources += [ "vulkan_ycbcr_info_mojom_traits.h" ] |
| } |
| configs += [ "//gpu:gpu_implementation" ] |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| sources = [ |
| "mock_command_buffer.cc", |
| "mock_command_buffer.h", |
| "mock_gpu_channel.cc", |
| "mock_gpu_channel.h", |
| ] |
| public_deps = [ |
| ":common", |
| "//testing/gmock", |
| ] |
| } |