blob: c956a2493cda4862770061ac14abe3c2e086af96 [file] [log] [blame]
# Copyright 2017 The Fuchsia 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("//third_party/flatbuffers/flatbuffer.gni")
import("build_args.gni")
declare_args() {
scenic_ignore_vsync = false
# Draws the current frame number in the top-left corner.
scenic_display_frame_number = false
}
config("common_include_dirs") {
include_dirs = [
"//garnet",
"//third_party/glm",
]
}
config("swapchain") {
defines = [
"SCENIC_IGNORE_VSYNC=$scenic_ignore_vsync",
"SCENIC_DISPLAY_FRAME_NUMBER=$scenic_display_frame_number",
]
}
source_set("common_gfx_config_source_set") {
visibility = [
":gfx",
":gfx_always_optimized",
]
}
# These sources (all part of :gfx) are especially performance-sensitive, so we
# apply full optimization in debug as well as --release.
source_set("gfx_always_optimized") {
visibility = [ ":gfx" ]
sources = [
"util/image_formats.cc",
"util/image_formats.h",
]
cflags = [
# Always optimize regardless of debug or --release.
"-O3",
]
public_configs = [ ":common_include_dirs" ]
public_deps = [ "//src/ui/lib/escher" ]
deps = [
"//sdk/lib/images/cpp",
"//src/ui/lib/yuv",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
source_set("gfx") {
sources = [
"api/internal_snapshot_impl.cc",
"api/internal_snapshot_impl.h",
"engine/annotation_manager.cc",
"engine/annotation_manager.h",
"engine/buffer_collection.cc",
"engine/buffer_collection.h",
"engine/engine.cc",
"engine/engine.h",
"engine/engine_renderer.cc",
"engine/engine_renderer.h",
"engine/engine_renderer_visitor.cc",
"engine/engine_renderer_visitor.h",
"engine/gfx_buffer_collection_importer.cc",
"engine/gfx_buffer_collection_importer.h",
"engine/gfx_command_applier.cc",
"engine/gfx_command_applier.h",
"engine/hit.h",
"engine/hit_accumulator.cc",
"engine/hit_accumulator.h",
"engine/hit_tester.cc",
"engine/hit_tester.h",
"engine/image_pipe_updater.cc",
"engine/image_pipe_updater.h",
"engine/resource_map.cc",
"engine/resource_map.h",
"engine/scene_graph.cc",
"engine/scene_graph.h",
"engine/session.cc",
"engine/session.h",
"engine/session_context.h",
"engine/session_manager.cc",
"engine/session_manager.h",
"engine/view_tree.cc",
"engine/view_tree.h",
"engine/view_tree_updater.cc",
"engine/view_tree_updater.h",
"gfx_system.cc",
"gfx_system.h",
"resources/buffer.cc",
"resources/buffer.h",
"resources/camera.cc",
"resources/camera.h",
"resources/compositor/compositor.cc",
"resources/compositor/compositor.h",
"resources/compositor/display_compositor.cc",
"resources/compositor/display_compositor.h",
"resources/compositor/layer.cc",
"resources/compositor/layer.h",
"resources/compositor/layer_stack.cc",
"resources/compositor/layer_stack.h",
"resources/dump_visitor.cc",
"resources/dump_visitor.h",
"resources/gpu_image.cc",
"resources/gpu_image.h",
"resources/has_renderable_content_visitor.cc",
"resources/has_renderable_content_visitor.h",
"resources/host_image.cc",
"resources/host_image.h",
"resources/image.cc",
"resources/image.h",
"resources/image_base.cc",
"resources/image_base.h",
"resources/image_pipe.cc",
"resources/image_pipe.h",
"resources/image_pipe2.cc",
"resources/image_pipe2.h",
"resources/image_pipe2_handler.cc",
"resources/image_pipe2_handler.h",
"resources/image_pipe_base.cc",
"resources/image_pipe_base.h",
"resources/image_pipe_handler.cc",
"resources/image_pipe_handler.h",
"resources/lights/ambient_light.cc",
"resources/lights/ambient_light.h",
"resources/lights/directional_light.cc",
"resources/lights/directional_light.h",
"resources/lights/light.cc",
"resources/lights/light.h",
"resources/lights/point_light.cc",
"resources/lights/point_light.h",
"resources/material.cc",
"resources/material.h",
"resources/memory.cc",
"resources/memory.h",
"resources/nodes/entity_node.cc",
"resources/nodes/entity_node.h",
"resources/nodes/node.cc",
"resources/nodes/node.h",
"resources/nodes/opacity_node.cc",
"resources/nodes/opacity_node.h",
"resources/nodes/scene.cc",
"resources/nodes/scene.h",
"resources/nodes/shape_node.cc",
"resources/nodes/shape_node.h",
"resources/nodes/traversal.h",
"resources/nodes/variable_binding.cc",
"resources/nodes/variable_binding.h",
"resources/nodes/view_node.cc",
"resources/nodes/view_node.h",
"resources/protected_memory_visitor.cc",
"resources/protected_memory_visitor.h",
"resources/renderers/renderer.cc",
"resources/renderers/renderer.h",
"resources/resource.cc",
"resources/resource.h",
"resources/resource_context.h",
"resources/resource_type_info.h",
"resources/resource_visitor.cc",
"resources/resource_visitor.h",
"resources/shapes/circle_shape.cc",
"resources/shapes/circle_shape.h",
"resources/shapes/mesh_shape.cc",
"resources/shapes/mesh_shape.h",
"resources/shapes/planar_shape.cc",
"resources/shapes/planar_shape.h",
"resources/shapes/rectangle_shape.cc",
"resources/shapes/rectangle_shape.h",
"resources/shapes/rounded_rectangle_shape.cc",
"resources/shapes/rounded_rectangle_shape.h",
"resources/shapes/shape.cc",
"resources/shapes/shape.h",
"resources/stereo_camera.cc",
"resources/stereo_camera.h",
"resources/variable.cc",
"resources/variable.h",
"resources/view.cc",
"resources/view.h",
"resources/view_holder.cc",
"resources/view_holder.h",
"screenshotter.cc",
"screenshotter.h",
"snapshot/serializer.h",
"snapshot/snapshotter.cc",
"snapshot/snapshotter.h",
"snapshot/version.h",
"swapchain/buffer_pool.cc",
"swapchain/buffer_pool.h",
"swapchain/display_swapchain.cc",
"swapchain/display_swapchain.h",
"swapchain/frame_timings.cc",
"swapchain/frame_timings.h",
"swapchain/swapchain.h",
"swapchain/swapchain_factory.cc",
"swapchain/swapchain_factory.h",
"sysmem.cc",
"sysmem.h",
]
public_configs = [ ":common_include_dirs" ]
configs += [ ":swapchain" ]
defines = []
if (scenic_enable_vulkan_validation) {
defines += [ "SCENIC_ENABLE_VULKAN_VALIDATION" ]
}
public_deps = [
":gfx_always_optimized",
":snapshot_fbs",
":util",
"//garnet/public/lib/fostr/fidl/fuchsia.ui.gfx",
# TODO(fxbug.dev/44143): Gfx should not depend on Input.
"//garnet/public/lib/fostr/fidl/fuchsia.ui.input",
"//sdk/fidl/fuchsia.math",
"//sdk/fidl/fuchsia.ui.annotation",
"//sdk/fidl/fuchsia.ui.focus",
"//sdk/fidl/fuchsia.ui.gfx",
"//sdk/fidl/fuchsia.ui.scenic",
"//sdk/fidl/fuchsia.ui.scenic.internal",
"//sdk/fidl/fuchsia.ui.views",
"//sdk/lib/fidl/cpp",
"//sdk/lib/fit",
"//sdk/lib/sys/cpp",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/lib/vulkan",
"//src/ui/lib/escher",
"//src/ui/scenic/lib/allocation",
"//src/ui/scenic/lib/display",
"//src/ui/scenic/lib/gfx:validate_eventpair",
"//src/ui/scenic/lib/scenic:command_dispatcher",
"//src/ui/scenic/lib/scenic:event_reporter",
"//src/ui/scenic/lib/scenic:system",
"//src/ui/scenic/lib/scenic:take_screenshot_delegate_deprecated",
"//src/ui/scenic/lib/scenic/util",
"//src/ui/scenic/lib/scheduling:frame_scheduler",
"//src/ui/scenic/lib/scheduling:present_helpers",
"//zircon/public/lib/zxc",
]
deps = [
":ids",
":object_linker",
":view_focuser_registry",
"//sdk/fidl/fuchsia.sysmem",
"//sdk/lib/ui/scenic/cpp",
"//src/graphics/display/drivers/display:preferred-scanout-image-type",
"//src/lib/fsl",
"//src/ui/lib/escher/util:check_vulkan_support",
"//src/ui/scenic/lib/display",
"//src/ui/scenic/lib/utils",
"//src/ui/scenic/lib/view_tree:view_tree_snapshot",
"//third_party/rapidjson",
"//zircon/public/lib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/trace",
]
}
source_set("object_linker") {
sources = [
"engine/object_linker.cc",
"engine/object_linker.h",
]
public_deps = [
"//sdk/lib/fit",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/ui/scenic/lib/scenic/util",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
source_set("view_focuser_registry") {
sources = [ "engine/view_focuser_registry.h" ]
deps = [
"//sdk/fidl/fuchsia.ui.views",
"//src/ui/scenic/lib/gfx:ids",
]
}
source_set("ids") {
sources = [
# TODO(fxbug.dev/24590): IDs don't belong here, but this will work until we factor
# out another system that needs ids outside of gfx.
"id.cc",
"id.h",
]
public_deps = [ "//src/ui/scenic/lib/scheduling:id" ]
}
source_set("util") {
sources = [
"util/time.h",
"util/unwrap.h",
"util/wrap.h",
]
deps = [
# TODO(fxbug.dev/24590): Needed by wrap/unwrap. Move to separate source_set?
"//src/lib/fxl",
"//src/ui/lib/escher",
]
}
source_set("validate_eventpair") {
sources = [
"util/validate_eventpair.cc",
"util/validate_eventpair.h",
]
deps = [
"//sdk/fidl/fuchsia.ui.views",
"//sdk/lib/syslog/cpp",
"//zircon/public/lib/zx",
"//zircon/system/public",
]
}
flatbuffer("snapshot_fbs") {
sources = [ "snapshot/snapshot.fbs" ]
}