diff --git a/BUILD.gn b/BUILD.gn index da186f16e70298..085b282f461972 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -18,6 +18,7 @@ group("root") { #"//base(//build/toolchain/nacl:x86_newlib)", "//apps/common/api:apps_api", + "//cc", #"//chrome", "//components/favicon_base", "//components/language_usage_metrics", @@ -38,8 +39,7 @@ group("root") { "//device/usb", #"//extensions/common/api:extensions_api", "//gin", - "//gpu/command_buffer/client", - "//gpu/command_buffer/service", + "//gpu", "//google_apis", "//ipc", "//mojo", @@ -98,6 +98,7 @@ group("root") { if (is_android) { deps -= [ + "//cc", "//content/public/common", "//content/public/renderer", "//ppapi:ppapi_c", @@ -109,8 +110,7 @@ group("root") { # This stuff all depends on ui/surface which requires some .class jni # generators (ui/gl/gl.gyp:surface_jni_headers). "//ui/gl", - "//gpu/command_buffer/client", - "//gpu/command_buffer/service", + "//gpu", "//ui/surface", ] } diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn index e26e397ec0ed85..18b1da4a6482d0 100644 --- a/build/config/linux/BUILD.gn +++ b/build/config/linux/BUILD.gn @@ -82,31 +82,63 @@ pkg_config("gconf") { defines = [ "USE_GCONF" ] } +# name: Name to use for the value of the --name arg. +# output_h/output_cc: Names for the generated header/cc file with no dir. +# header: header file to process. Example: "" +# functions: List of strings for functions to process. +# config: Label of the config generated by pkgconfig. +template("generate_library_loader") { + output_h = "$root_gen_dir/library_loaders/" + invoker.output_h + output_cc = "$root_gen_dir/library_loaders/" + invoker.output_cc + + action_visibility = ":$target_name" + action("${target_name}_loader") { + visibility = action_visibility + + script = "//tools/generate_library_loader/generate_library_loader.py" + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + + outputs = [ output_h, output_cc ] + + args = [ + "--name", invoker.name, + "--output-h", rebase_path(output_h), + "--output-cc", rebase_path(output_cc), + "--header", invoker.header, + # Note GYP build exposes a per-target variable to control this, which, if + # manually set to true, will disable dlopen(). Its not clear this is + # needed, so here we just leave off. If this can be done globally, we + # can expose one switch for this value, otherwise we need to add a template + # param for this. + "--link-directly=0", + ] + invoker.functions + } + + source_set(target_name) { + direct_dependent_configs = [ invoker.config ] + sources = [ output_h, output_cc ] + deps = [ ":${target_name}_loader" ] + } +} + pkg_config("gio_config") { packages = [ "gio-2.0" ] defines = [ "USE_GIO" ] + ignore_libs = true # Loader generated below. } -gio_output_h = "$root_gen_dir/library_loaders/libgio.h" -gio_output_cc = "$root_gen_dir/library_loaders/libgio_loader.cc" +# This generates a target named "gio". +generate_library_loader("gio") { + name = "LibGioLoader" + output_h = "libgio.h" + output_cc = "libgio_loader.cc" + # TODO(brettw) convert ti "" once GN doesn't mangle <>. + header = "\"gio/gio.h\"" + config = ":gio_config" -action("make_gio_headers") { - visibility = ":gio" - - script = "//tools/generate_library_loader/generate_library_loader.py" - - outputs = [ gio_output_h, gio_output_cc ] - - args = [ - "--name", "LibGioLoader", - "--output-h", rebase_path(gio_output_h), - "--output-cc", rebase_path(gio_output_cc), - # TODO(brettw) convert ti "" once GN doesn't mangle <>. - "--header", "\"gio/gio.h\"", - # Note GYP build exposes a variable linux_link_gsettings to control this, - # which, if manually set to true, will disable dlopen() for this. Its not - # clear this is needed, so here we just leave off. - "--link-directly=0", + functions = [ "g_settings_new", "g_settings_get_child", "g_settings_get_string", @@ -117,8 +149,29 @@ action("make_gio_headers") { ] } -source_set("gio") { - direct_dependent_configs = [ ":gio_config" ] - sources = [ gio_output_h, gio_output_cc ] - deps = [ ":make_gio_headers" ] +# pkgconfig doesn't return anything interesting for this other than -lpci +# on suppotred systems, so we hardcode. +config("libpci_config") { + # This is not needed as long as we're setting link_directly=0 for the library + # loaders. + #libs = [ "pci" ] +} + +# This generates a target named "libpci". +generate_library_loader("libpci") { + name = "LibPciLoader" + output_h = "libpci.h" + output_cc = "libpci_loader.cc" + # TODO(brettw) convert to "" once GN doesn't mangle <>. + header = "\"pci/pci.h\"" + config = ":libpci_config" + + functions = [ + "pci_alloc", + "pci_init", + "pci_cleanup", + "pci_scan_bus", + "pci_fill_info", + "pci_lookup_name", + ] } diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index c6a3099f1eb856..46f7d7590e6dc0 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -20,6 +20,9 @@ import("//build/config/sysroot.gni") # # You can also use "extra args" to filter out results (see pkg-config.py): # extra_args = [ "-v, "foo" ] +# To ignore libs and ldflags (only cflags/defines will be set, which is useful +# when doing manual dynamic linking), set: +# ignore_libs = true template("pkg_config") { assert(defined(invoker.packages), @@ -40,9 +43,12 @@ template("pkg_config") { args, "value") include_dirs = pkgresult[0] cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] - ldflags = pkgresult[4] + + if (!defined(invoker.ignore_libs) || !invoker.ignore_libs) { + libs = pkgresult[2] + lib_dirs = pkgresult[3] + ldflags = pkgresult[4] + } if (defined(invoker.defines)) { defines = invoker.defines diff --git a/cc/BUILD.gn b/cc/BUILD.gn new file mode 100644 index 00000000000000..fef36f1eb1fb71 --- /dev/null +++ b/cc/BUILD.gn @@ -0,0 +1,781 @@ +# Copyright 2014 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. + +component("cc") { + sources = [ + "animation/animation.cc", + "animation/animation.h", + "animation/animation_curve.cc", + "animation/animation_curve.h", + "animation/animation_delegate.h", + "animation/animation_events.cc", + "animation/animation_events.h", + "animation/animation_id_provider.cc", + "animation/animation_id_provider.h", + "animation/animation_registrar.cc", + "animation/animation_registrar.h", + "animation/keyframed_animation_curve.cc", + "animation/keyframed_animation_curve.h", + "animation/layer_animation_controller.cc", + "animation/layer_animation_controller.h", + "animation/layer_animation_event_observer.h", + "animation/layer_animation_value_observer.h", + "animation/layer_animation_value_provider.h", + "animation/scroll_offset_animation_curve.cc", + "animation/scroll_offset_animation_curve.h", + "animation/scrollbar_animation_controller.h", + "animation/scrollbar_animation_controller.cc", + "animation/scrollbar_animation_controller_linear_fade.cc", + "animation/scrollbar_animation_controller_linear_fade.h", + "animation/scrollbar_animation_controller_thinning.cc", + "animation/scrollbar_animation_controller_thinning.h", + "animation/timing_function.cc", + "animation/timing_function.h", + "animation/transform_operation.cc", + "animation/transform_operation.h", + "animation/transform_operations.cc", + "animation/transform_operations.h", + "base/completion_event.h", + "base/invalidation_region.cc", + "base/invalidation_region.h", + "base/latency_info_swap_promise.cc", + "base/latency_info_swap_promise.h", + "base/latency_info_swap_promise_monitor.cc", + "base/latency_info_swap_promise_monitor.h", + "base/math_util.cc", + "base/math_util.h", + "base/ref_counted_managed.h", + "base/region.cc", + "base/region.h", + "base/rolling_time_delta_history.cc", + "base/rolling_time_delta_history.h", + "base/scoped_ptr_algorithm.h", + "base/scoped_ptr_deque.h", + "base/scoped_ptr_vector.h", + "base/swap_promise.h", + "base/swap_promise_monitor.cc", + "base/swap_promise_monitor.h", + "base/switches.cc", + "base/switches.h", + "base/tiling_data.cc", + "base/tiling_data.h", + "base/util.h", + "debug/benchmark_instrumentation.cc", + "debug/benchmark_instrumentation.h", + "debug/debug_colors.cc", + "debug/debug_colors.h", + "debug/debug_rect_history.cc", + "debug/debug_rect_history.h", + "debug/devtools_instrumentation.h", + "debug/frame_rate_counter.cc", + "debug/frame_rate_counter.h", + "debug/frame_viewer_instrumentation.h", + "debug/lap_timer.cc", + "debug/lap_timer.h", + "debug/layer_tree_debug_state.cc", + "debug/layer_tree_debug_state.h", + "debug/micro_benchmark.cc", + "debug/micro_benchmark.h", + "debug/micro_benchmark_impl.cc", + "debug/micro_benchmark_impl.h", + "debug/micro_benchmark_controller.cc", + "debug/micro_benchmark_controller.h", + "debug/micro_benchmark_controller_impl.cc", + "debug/micro_benchmark_controller_impl.h", + "debug/paint_time_counter.cc", + "debug/paint_time_counter.h", + "debug/picture_record_benchmark.cc", + "debug/picture_record_benchmark.h", + "debug/rasterize_and_record_benchmark.cc", + "debug/rasterize_and_record_benchmark.h", + "debug/rasterize_and_record_benchmark_impl.cc", + "debug/rasterize_and_record_benchmark_impl.h", + "debug/rendering_stats.cc", + "debug/rendering_stats.h", + "debug/rendering_stats_instrumentation.cc", + "debug/rendering_stats_instrumentation.h", + "debug/ring_buffer.h", + "debug/traced_picture.cc", + "debug/traced_picture.h", + "debug/traced_value.cc", + "debug/traced_value.h", + "debug/unittest_only_benchmark.cc", + "debug/unittest_only_benchmark.h", + "debug/unittest_only_benchmark_impl.cc", + "debug/unittest_only_benchmark_impl.h", + "input/input_handler.h", + "input/page_scale_animation.cc", + "input/page_scale_animation.h", + "input/top_controls_manager.cc", + "input/top_controls_manager.h", + "input/top_controls_manager_client.h", + "layers/append_quads_data.h", + "layers/content_layer.cc", + "layers/content_layer.h", + "layers/content_layer_client.h", + "layers/contents_scaling_layer.cc", + "layers/contents_scaling_layer.h", + "layers/delegated_frame_provider.cc", + "layers/delegated_frame_provider.h", + "layers/delegated_frame_resource_collection.cc", + "layers/delegated_frame_resource_collection.h", + "layers/delegated_renderer_layer.cc", + "layers/delegated_renderer_layer.h", + "layers/delegated_renderer_layer_impl.cc", + "layers/delegated_renderer_layer_impl.h", + "layers/draw_properties.h", + "layers/heads_up_display_layer.cc", + "layers/heads_up_display_layer.h", + "layers/heads_up_display_layer_impl.cc", + "layers/heads_up_display_layer_impl.h", + "layers/image_layer.cc", + "layers/image_layer.h", + "layers/io_surface_layer.cc", + "layers/io_surface_layer.h", + "layers/io_surface_layer_impl.cc", + "layers/io_surface_layer_impl.h", + "layers/layer.cc", + "layers/layer.h", + "layers/layer_client.h", + "layers/layer_impl.cc", + "layers/layer_impl.h", + "layers/layer_iterator.h", + "layers/layer_lists.cc", + "layers/layer_lists.h", + "layers/layer_position_constraint.cc", + "layers/layer_position_constraint.h", + "layers/layer_utils.cc", + "layers/layer_utils.h", + "layers/nine_patch_layer.cc", + "layers/nine_patch_layer.h", + "layers/nine_patch_layer_impl.cc", + "layers/nine_patch_layer_impl.h", + "layers/paint_properties.h", + "layers/painted_scrollbar_layer.cc", + "layers/painted_scrollbar_layer.h", + "layers/painted_scrollbar_layer_impl.cc", + "layers/painted_scrollbar_layer_impl.h", + "layers/picture_image_layer.cc", + "layers/picture_image_layer.h", + "layers/picture_image_layer_impl.cc", + "layers/picture_image_layer_impl.h", + "layers/picture_layer.cc", + "layers/picture_layer.h", + "layers/picture_layer_impl.cc", + "layers/picture_layer_impl.h", + "layers/quad_sink.h", + "layers/render_pass_sink.h", + "layers/render_surface.cc", + "layers/render_surface.h", + "layers/render_surface_impl.cc", + "layers/render_surface_impl.h", + "layers/scrollbar_layer_impl_base.cc", + "layers/scrollbar_layer_impl_base.h", + "layers/scrollbar_layer_interface.h", + "layers/solid_color_layer.cc", + "layers/solid_color_layer.h", + "layers/solid_color_layer_impl.cc", + "layers/solid_color_layer_impl.h", + "layers/solid_color_scrollbar_layer.cc", + "layers/solid_color_scrollbar_layer.h", + "layers/solid_color_scrollbar_layer_impl.cc", + "layers/solid_color_scrollbar_layer_impl.h", + "layers/surface_layer.cc", + "layers/surface_layer.h", + "layers/surface_layer_impl.cc", + "layers/surface_layer_impl.h", + "layers/texture_layer.cc", + "layers/texture_layer.h", + "layers/texture_layer_client.h", + "layers/texture_layer_impl.cc", + "layers/texture_layer_impl.h", + "layers/tiled_layer.cc", + "layers/tiled_layer.h", + "layers/tiled_layer_impl.cc", + "layers/tiled_layer_impl.h", + "layers/ui_resource_layer.cc", + "layers/ui_resource_layer.h", + "layers/ui_resource_layer_impl.cc", + "layers/ui_resource_layer_impl.h", + "layers/video_frame_provider.h", + "layers/video_frame_provider_client_impl.cc", + "layers/video_frame_provider_client_impl.h", + "layers/video_layer.cc", + "layers/video_layer.h", + "layers/video_layer_impl.cc", + "layers/video_layer_impl.h", + "output/begin_frame_args.cc", + "output/begin_frame_args.h", + "output/compositor_frame.cc", + "output/compositor_frame.h", + "output/compositor_frame_ack.cc", + "output/compositor_frame_ack.h", + "output/compositor_frame_metadata.cc", + "output/compositor_frame_metadata.h", + "output/context_provider.cc", + "output/context_provider.h", + "output/copy_output_request.cc", + "output/copy_output_request.h", + "output/copy_output_result.cc", + "output/copy_output_result.h", + "output/delegated_frame_data.h", + "output/delegated_frame_data.cc", + "output/delegating_renderer.cc", + "output/delegating_renderer.h", + "output/direct_renderer.cc", + "output/direct_renderer.h", + "output/filter_operation.cc", + "output/filter_operation.h", + "output/filter_operations.cc", + "output/filter_operations.h", + "output/geometry_binding.cc", + "output/geometry_binding.h", + "output/gl_frame_data.h", + "output/gl_frame_data.cc", + "output/gl_renderer.cc", + "output/gl_renderer.h", + "output/gl_renderer_draw_cache.cc", + "output/gl_renderer_draw_cache.h", + "output/managed_memory_policy.cc", + "output/managed_memory_policy.h", + "output/output_surface.cc", + "output/output_surface.h", + "output/output_surface_client.h", + "output/overlay_candidate.cc", + "output/overlay_candidate.h", + "output/overlay_candidate_validator.h", + "output/overlay_processor.cc", + "output/overlay_processor.h", + "output/overlay_strategy_single_on_top.cc", + "output/overlay_strategy_single_on_top.h", + "output/program_binding.cc", + "output/program_binding.h", + "output/render_surface_filters.cc", + "output/render_surface_filters.h", + "output/renderer.cc", + "output/renderer.h", + "output/shader.cc", + "output/shader.h", + "output/software_frame_data.cc", + "output/software_frame_data.h", + "output/software_output_device.cc", + "output/software_output_device.h", + "output/software_renderer.cc", + "output/software_renderer.h", + "quads/checkerboard_draw_quad.cc", + "quads/checkerboard_draw_quad.h", + "quads/content_draw_quad_base.cc", + "quads/content_draw_quad_base.h", + "quads/debug_border_draw_quad.cc", + "quads/debug_border_draw_quad.h", + "quads/draw_quad.cc", + "quads/draw_quad.h", + "quads/io_surface_draw_quad.cc", + "quads/io_surface_draw_quad.h", + "quads/picture_draw_quad.cc", + "quads/picture_draw_quad.h", + "quads/render_pass.cc", + "quads/render_pass.h", + "quads/render_pass_draw_quad.cc", + "quads/render_pass_draw_quad.h", + "quads/shared_quad_state.cc", + "quads/shared_quad_state.h", + "quads/solid_color_draw_quad.cc", + "quads/solid_color_draw_quad.h", + "quads/stream_video_draw_quad.cc", + "quads/stream_video_draw_quad.h", + "quads/surface_draw_quad.cc", + "quads/surface_draw_quad.h", + "quads/texture_draw_quad.cc", + "quads/texture_draw_quad.h", + "quads/tile_draw_quad.cc", + "quads/tile_draw_quad.h", + "quads/yuv_video_draw_quad.cc", + "quads/yuv_video_draw_quad.h", + "resources/bitmap_content_layer_updater.cc", + "resources/bitmap_content_layer_updater.h", + "resources/bitmap_skpicture_content_layer_updater.cc", + "resources/bitmap_skpicture_content_layer_updater.h", + "resources/content_layer_updater.cc", + "resources/content_layer_updater.h", + "resources/direct_raster_worker_pool.cc", + "resources/direct_raster_worker_pool.h", + "resources/image_layer_updater.cc", + "resources/image_layer_updater.h", + "resources/image_raster_worker_pool.cc", + "resources/image_raster_worker_pool.h", + "resources/image_copy_raster_worker_pool.cc", + "resources/image_copy_raster_worker_pool.h", + "resources/layer_painter.h", + "resources/layer_quad.cc", + "resources/layer_quad.h", + "resources/layer_tiling_data.cc", + "resources/layer_tiling_data.h", + "resources/layer_updater.cc", + "resources/layer_updater.h", + "resources/managed_tile_state.cc", + "resources/managed_tile_state.h", + "resources/memory_history.cc", + "resources/memory_history.h", + "resources/picture.cc", + "resources/picture.h", + "resources/picture_layer_tiling.cc", + "resources/picture_layer_tiling.h", + "resources/picture_layer_tiling_set.cc", + "resources/picture_layer_tiling_set.h", + "resources/picture_pile.cc", + "resources/picture_pile.h", + "resources/picture_pile_base.cc", + "resources/picture_pile_base.h", + "resources/picture_pile_impl.cc", + "resources/picture_pile_impl.h", + "resources/pixel_buffer_raster_worker_pool.cc", + "resources/pixel_buffer_raster_worker_pool.h", + "resources/platform_color.h", + "resources/prioritized_resource.cc", + "resources/prioritized_resource.h", + "resources/prioritized_resource_manager.cc", + "resources/prioritized_resource_manager.h", + "resources/prioritized_tile_set.cc", + "resources/prioritized_tile_set.h", + "resources/priority_calculator.cc", + "resources/priority_calculator.h", + "resources/raster_mode.cc", + "resources/raster_mode.h", + "resources/raster_worker_pool.cc", + "resources/raster_worker_pool.h", + "resources/rasterizer.cc", + "resources/rasterizer.h", + "resources/release_callback.h", + "resources/resource.cc", + "resources/resource.h", + "resources/resource_format.h", + "resources/resource_format.cc", + "resources/resource_pool.cc", + "resources/resource_pool.h", + "resources/resource_provider.cc", + "resources/resource_provider.h", + "resources/resource_update.cc", + "resources/resource_update.h", + "resources/resource_update_controller.cc", + "resources/resource_update_controller.h", + "resources/resource_update_queue.cc", + "resources/resource_update_queue.h", + "resources/returned_resource.h", + "resources/scoped_resource.cc", + "resources/scoped_resource.h", + "resources/scoped_ui_resource.cc", + "resources/scoped_ui_resource.h", + "resources/shared_bitmap.cc", + "resources/shared_bitmap.h", + "resources/shared_bitmap_manager.h", + "resources/single_release_callback.cc", + "resources/single_release_callback.h", + "resources/skpicture_content_layer_updater.cc", + "resources/skpicture_content_layer_updater.h", + "resources/task_graph_runner.cc", + "resources/task_graph_runner.h", + "resources/texture_mailbox.cc", + "resources/texture_mailbox.h", + "resources/texture_mailbox_deleter.cc", + "resources/texture_mailbox_deleter.h", + "resources/texture_uploader.cc", + "resources/texture_uploader.h", + "resources/tile.cc", + "resources/tile.h", + "resources/tile_manager.cc", + "resources/tile_manager.h", + "resources/tile_priority.cc", + "resources/tile_priority.h", + "resources/transferable_resource.cc", + "resources/transferable_resource.h", + "resources/ui_resource_bitmap.cc", + "resources/ui_resource_bitmap.h", + "resources/ui_resource_client.h", + "resources/ui_resource_request.cc", + "resources/ui_resource_request.h", + "resources/video_resource_updater.cc", + "resources/video_resource_updater.h", + "scheduler/delay_based_time_source.cc", + "scheduler/delay_based_time_source.h", + "scheduler/draw_result.h", + "scheduler/scheduler.cc", + "scheduler/scheduler.h", + "scheduler/scheduler_settings.cc", + "scheduler/scheduler_settings.h", + "scheduler/scheduler_state_machine.cc", + "scheduler/scheduler_state_machine.h", + "scheduler/time_source.h", + "trees/blocking_task_runner.cc", + "trees/blocking_task_runner.h", + "trees/damage_tracker.cc", + "trees/damage_tracker.h", + "trees/layer_sorter.cc", + "trees/layer_sorter.h", + "trees/layer_tree_host.cc", + "trees/layer_tree_host.h", + "trees/layer_tree_host_client.h", + "trees/layer_tree_host_common.cc", + "trees/layer_tree_host_common.h", + "trees/layer_tree_host_impl.cc", + "trees/layer_tree_host_impl.h", + "trees/layer_tree_impl.cc", + "trees/layer_tree_impl.h", + "trees/layer_tree_settings.cc", + "trees/layer_tree_settings.h", + "trees/occlusion_tracker.cc", + "trees/occlusion_tracker.h", + "trees/proxy.cc", + "trees/proxy.h", + "trees/proxy_timing_history.cc", + "trees/proxy_timing_history.h", + "trees/quad_culler.cc", + "trees/quad_culler.h", + "trees/single_thread_proxy.cc", + "trees/single_thread_proxy.h", + "trees/thread_proxy.cc", + "trees/thread_proxy.h", + "trees/tree_synchronizer.cc", + "trees/tree_synchronizer.h", + ] + + if (is_win) { + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + cflags = [ "/wd4267" ] # size_t -> int + } + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//gpu", + #"//media", TODO(GYP) + "//skia", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gl", + ] + forward_dependent_configs_from = [ + "//skia", + ] + + defined = [ "CC_IMPLEMENTATION=1" ] + + if (!is_debug && is_win) { + configs -= [ "//build/config/compiler:optimize" ] + configs += [ "//build/config/compiler:optimize_max" ] + } +} + +component("cc_surfaces") { + sources = [ + "surfaces/surface.cc", + "surfaces/surface.h", + "surfaces/surface_aggregator.cc", + "surfaces/surface_aggregator.h", + "surfaces/surface_manager.cc", + "surfaces/surface_manager.h", + "surfaces/surfaces_export.h", + ] + + defines = [ "CC_SURFACES_IMPLEMENTATION=1" ] + + deps = [ + ":cc", + "//base", + "//base/third_party/dynamic_annotations", + "//skia", + "//ui/gfx", + "//ui/gfx/geometry", + ] +} + +source_set("test_support") { + sources = [ + "test/animation_test_common.cc", + "test/animation_test_common.h", + "test/begin_frame_args_test.cc", + "test/begin_frame_args_test.h", + "test/fake_content_layer.cc", + "test/fake_content_layer.h", + "test/fake_content_layer_client.cc", + "test/fake_content_layer_client.h", + "test/fake_content_layer_impl.cc", + "test/fake_content_layer_impl.h", + "test/fake_delegated_renderer_layer.cc", + "test/fake_delegated_renderer_layer.h", + "test/fake_delegated_renderer_layer_impl.cc", + "test/fake_delegated_renderer_layer_impl.h", + "test/fake_impl_proxy.h", + "test/fake_layer_tree_host.cc", + "test/fake_layer_tree_host.h", + "test/fake_layer_tree_host_client.cc", + "test/fake_layer_tree_host_client.h", + "test/fake_layer_tree_host_impl.cc", + "test/fake_layer_tree_host_impl.h", + "test/fake_layer_tree_host_impl_client.cc", + "test/fake_layer_tree_host_impl_client.h", + "test/fake_output_surface.cc", + "test/fake_output_surface.h", + "test/fake_output_surface_client.cc", + "test/fake_output_surface_client.h", + "test/fake_painted_scrollbar_layer.cc", + "test/fake_painted_scrollbar_layer.h", + "test/fake_picture_layer.cc", + "test/fake_picture_layer.h", + "test/fake_picture_layer_impl.cc", + "test/fake_picture_layer_impl.h", + "test/fake_picture_layer_tiling_client.cc", + "test/fake_picture_layer_tiling_client.h", + "test/fake_picture_pile_impl.cc", + "test/fake_picture_pile_impl.h", + "test/fake_proxy.cc", + "test/fake_proxy.h", + "test/fake_renderer_client.cc", + "test/fake_renderer_client.h", + "test/fake_rendering_stats_instrumentation.h", + "test/fake_scoped_ui_resource.cc", + "test/fake_scoped_ui_resource.h", + "test/fake_scrollbar.cc", + "test/fake_scrollbar.h", + "test/fake_tile_manager.cc", + "test/fake_tile_manager.h", + "test/fake_tile_manager_client.cc", + "test/fake_tile_manager_client.h", + "test/fake_ui_resource_layer_tree_host_impl.cc", + "test/fake_ui_resource_layer_tree_host_impl.h", + "test/fake_video_frame_provider.cc", + "test/fake_video_frame_provider.h", + "test/geometry_test_utils.cc", + "test/geometry_test_utils.h", + "test/test_in_process_context_provider.cc", + "test/test_in_process_context_provider.h", + "test/impl_side_painting_settings.h", + "test/layer_test_common.cc", + "test/layer_test_common.h", + "test/layer_tree_host_common_test.cc", + "test/layer_tree_host_common_test.h", + "test/layer_tree_json_parser.cc", + "test/layer_tree_json_parser.h", + "test/layer_tree_pixel_test.cc", + "test/layer_tree_pixel_test.h", + "test/layer_tree_test.cc", + "test/layer_tree_test.h", + "test/mock_quad_culler.cc", + "test/mock_quad_culler.h", + "test/ordered_texture_map.cc", + "test/ordered_texture_map.h", + "test/paths.cc", + "test/paths.h", + "test/pixel_comparator.cc", + "test/pixel_comparator.h", + "test/pixel_test.cc", + "test/pixel_test.h", + "test/pixel_test_output_surface.cc", + "test/pixel_test_output_surface.h", + "test/pixel_test_software_output_device.cc", + "test/pixel_test_software_output_device.h", + "test/pixel_test_utils.cc", + "test/pixel_test_utils.h", + "test/render_pass_test_common.cc", + "test/render_pass_test_common.h", + "test/render_pass_test_utils.cc", + "test/render_pass_test_utils.h", + "test/scheduler_test_common.cc", + "test/scheduler_test_common.h", + "test/skia_common.cc", + "test/skia_common.h", + "test/solid_color_content_layer_client.cc", + "test/solid_color_content_layer_client.h", + "test/test_context_provider.cc", + "test/test_context_provider.h", + "test/test_context_support.cc", + "test/test_context_support.h", + "test/test_gles2_interface.cc", + "test/test_gles2_interface.h", + "test/test_occlusion_tracker.h", + "test/test_shared_bitmap_manager.cc", + "test/test_shared_bitmap_manager.h", + "test/test_texture.cc", + "test/test_texture.h", + "test/test_tile_priorities.cc", + "test/test_tile_priorities.h", + "test/test_web_graphics_context_3d.cc", + "test/test_web_graphics_context_3d.h", + "test/tiled_layer_test_common.cc", + "test/tiled_layer_test_common.h", + ] + + include_dirs = [ + ".", + "test", + ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//gpu:gpu_unittest_utils", + "//gpu/command_buffer/client:gles2_c_lib", + "//gpu/command_buffer/client:gles2_implementation", + "//gpu/command_buffer/client:gl_in_process_context", + "//gpu/skia_bindings", + "//skia", + "//testing/gmock", + "//testing/gtest", + # TODO(GYP) + #"//third_party/mesa/mesa.gyp:osmesa", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx:gfx_test_support", + "//ui/gl", + ] +} + +# TODO(GYP) make these tests link when all deps are resolved. +if (false) { + +test("cc_unittests") { + sources = [ + "animation/animation_unittest.cc", + "animation/keyframed_animation_curve_unittest.cc", + "animation/layer_animation_controller_unittest.cc", + "animation/scroll_offset_animation_curve_unittest.cc", + "animation/scrollbar_animation_controller_linear_fade_unittest.cc", + "animation/scrollbar_animation_controller_thinning_unittest.cc", + "animation/transform_operations_unittest.cc", + "base/float_quad_unittest.cc", + "base/math_util_unittest.cc", + "base/region_unittest.cc", + "base/rolling_time_delta_history_unittest.cc", + "base/scoped_ptr_vector_unittest.cc", + "base/tiling_data_unittest.cc", + "base/util_unittest.cc", + "debug/micro_benchmark_controller_unittest.cc", + "input/top_controls_manager_unittest.cc", + "layers/content_layer_unittest.cc", + "layers/contents_scaling_layer_unittest.cc", + "layers/delegated_frame_provider_unittest.cc", + "layers/delegated_frame_resource_collection_unittest.cc", + "layers/delegated_renderer_layer_impl_unittest.cc", + "layers/heads_up_display_unittest.cc", + "layers/heads_up_display_layer_impl_unittest.cc", + "layers/io_surface_layer_impl_unittest.cc", + "layers/layer_impl_unittest.cc", + "layers/layer_iterator_unittest.cc", + "layers/layer_position_constraint_unittest.cc", + "layers/layer_unittest.cc", + "layers/layer_utils_unittest.cc", + "layers/nine_patch_layer_impl_unittest.cc", + "layers/nine_patch_layer_unittest.cc", + "layers/painted_scrollbar_layer_impl_unittest.cc", + "layers/picture_image_layer_impl_unittest.cc", + "layers/picture_layer_impl_unittest.cc", + "layers/picture_layer_unittest.cc", + "layers/render_surface_unittest.cc", + "layers/render_surface_impl_unittest.cc", + "layers/scrollbar_layer_unittest.cc", + "layers/solid_color_layer_impl_unittest.cc", + "layers/solid_color_scrollbar_layer_impl_unittest.cc", + "layers/surface_layer_impl_unittest.cc", + "layers/texture_layer_unittest.cc", + "layers/texture_layer_impl_unittest.cc", + "layers/tiled_layer_impl_unittest.cc", + "layers/tiled_layer_unittest.cc", + "layers/ui_resource_layer_impl_unittest.cc", + "layers/ui_resource_layer_unittest.cc", + "layers/video_layer_impl_unittest.cc", + "output/begin_frame_args_unittest.cc", + "output/delegating_renderer_unittest.cc", + "output/filter_operations_unittest.cc", + "output/gl_renderer_unittest.cc", + "output/output_surface_unittest.cc", + "output/overlay_unittest.cc", + "output/renderer_pixeltest.cc", + "output/renderer_unittest.cc", + "output/shader_unittest.cc", + "output/software_renderer_unittest.cc", + "quads/draw_quad_unittest.cc", + "quads/render_pass_unittest.cc", + "resources/layer_quad_unittest.cc", + "resources/picture_layer_tiling_set_unittest.cc", + "resources/picture_layer_tiling_unittest.cc", + "resources/picture_pile_impl_unittest.cc", + "resources/picture_pile_unittest.cc", + "resources/picture_unittest.cc", + "resources/prioritized_resource_unittest.cc", + "resources/prioritized_tile_set_unittest.cc", + "resources/raster_worker_pool_unittest.cc", + "resources/resource_provider_unittest.cc", + "resources/resource_update_controller_unittest.cc", + "resources/scoped_resource_unittest.cc", + "resources/task_graph_runner_unittest.cc", + "resources/texture_mailbox_deleter_unittest.cc", + "resources/texture_uploader_unittest.cc", + "resources/tile_manager_unittest.cc", + "resources/tile_priority_unittest.cc", + "resources/video_resource_updater_unittest.cc", + "scheduler/delay_based_time_source_unittest.cc", + "scheduler/scheduler_state_machine_unittest.cc", + "scheduler/scheduler_unittest.cc", + "test/layer_tree_json_parser_unittest.cc", + "test/test_web_graphics_context_3d_unittest.cc", + "trees/damage_tracker_unittest.cc", + "trees/layer_sorter_unittest.cc", + "trees/layer_tree_host_common_unittest.cc", + "trees/layer_tree_host_impl_unittest.cc", + "trees/layer_tree_host_pixeltest_blending.cc", + "trees/layer_tree_host_pixeltest_filters.cc", + "trees/layer_tree_host_pixeltest_masks.cc", + "trees/layer_tree_host_pixeltest_on_demand_raster.cc", + "trees/layer_tree_host_pixeltest_readback.cc", + "trees/layer_tree_host_unittest.cc", + "trees/layer_tree_host_unittest_animation.cc", + "trees/layer_tree_host_unittest_context.cc", + "trees/layer_tree_host_unittest_copyrequest.cc", + "trees/layer_tree_host_unittest_damage.cc", + "trees/layer_tree_host_unittest_delegated.cc", + "trees/layer_tree_host_unittest_occlusion.cc", + "trees/layer_tree_host_unittest_no_message_loop.cc", + "trees/layer_tree_host_unittest_picture.cc", + "trees/layer_tree_host_unittest_proxy.cc", + "trees/layer_tree_host_unittest_scroll.cc", + "trees/layer_tree_host_unittest_video.cc", + "trees/layer_tree_impl_unittest.cc", + "trees/occlusion_tracker_unittest.cc", + "trees/tree_synchronizer_unittest.cc", + + # Surfaces test files. + "surfaces/surface_aggregator_test_helpers.cc", + "surfaces/surface_aggregator_test_helpers.h", + "surfaces/surface_aggregator_unittest.cc", + "surfaces/surface_unittest.cc", + "surfaces/surfaces_pixeltest.cc", + + # Setup. + "test/run_all_unittests.cc", + "test/cc_test_suite.cc", + ] + + deps = [ + ":cc", + ":cc_surfaces", + ":test_support", + "//base/test:test_support", + "//gpu", + "//gpu:gpu_unittest_utils", + # TODO(GYP) + #"//media", + "//testing/gmock", + "//testing/gtest", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + ] +} + +test("cc_perftests") { + # TODO(GYP) +} + +} # if false diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index 7cc0549ba8bd56..b810a8a8ab91d7 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn @@ -13,9 +13,121 @@ # gpu.gyp:gles2_c_lib => //gpu/command_buffer/client:gles2_c_lib # # gpu.gyp:gles2_implementation => -# //gpu_command_buffer/client:gles2_implementation +# //gpu/command_buffer/client:gles2_implementation + +# gpu.gyp:gles2_implementation_client_side_arrays => +# //gpu/command_buffer/client:gles2_implementation_client_side_arrays +# +# gpu.gyp:gpu_config => //gpu/config +# +# gpu.gyp:gpu_ipc => //gpu/ipc +# +# gpu.gyp:disk_cache_proto => //gpu/command_buffer/service:disk_cache_proto # # command_buffer/command_buffer.gyp:gles2_utils => # //gpu/command_buffer/common # (Merged in to here because the separate file exists in GYP only to break # a .gyp file dependency cycle which GN doesn't have.) + +component("gpu") { + deps = [ + "//gpu/command_buffer/client", + "//gpu/command_buffer/common", + "//gpu/command_buffer/service", + "//gpu/command_buffer/client:gles2_cmd_helper", + "//gpu/config", + "//gpu/ipc", + ] +} + +source_set("gpu_unittest_utils") { + sources = [ + "command_buffer/service/gles2_cmd_decoder_mock.cc", + "command_buffer/service/error_state_mock.cc", + "command_buffer/client/gles2_interface_stub.cc", + "command_buffer/client/gles2_interface_stub.h", + ] + + configs += [ "//third_party/khronos:khronos_headers" ] + + deps = [ + ":gpu", + "//testing/gmock", + "//testing/gtest", + "//ui/gl:gl_unittest_utils", + ] +} + +# TODO(GYP) This doesn't link yet. +if (false) { +test("gl_tests") { + sources = [ + "command_buffer/tests/compressed_texture_test.cc", + "command_buffer/tests/gl_bind_uniform_location_unittest.cc", + "command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc", + "command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc", + "command_buffer/tests/gl_depth_texture_unittest.cc", + "command_buffer/tests/gl_gpu_memory_buffer_unittest.cc", + "command_buffer/tests/gl_lose_context_chromium_unittest.cc", + "command_buffer/tests/gl_manager.cc", + "command_buffer/tests/gl_manager.h", + "command_buffer/tests/gl_pointcoord_unittest.cc", + "command_buffer/tests/gl_program_unittest.cc", + "command_buffer/tests/gl_query_unittest.cc", + "command_buffer/tests/gl_readback_unittest.cc", + "command_buffer/tests/gl_shared_resources_unittest.cc", + "command_buffer/tests/gl_stream_draw_unittest.cc", + "command_buffer/tests/gl_test_utils.cc", + "command_buffer/tests/gl_test_utils.h", + "command_buffer/tests/gl_tests_main.cc", + "command_buffer/tests/gl_texture_mailbox_unittest.cc", + "command_buffer/tests/gl_texture_storage_unittest.cc", + "command_buffer/tests/gl_unittest.cc", + "command_buffer/tests/gl_unittests_android.cc", + "command_buffer/tests/gl_virtual_contexts_unittest.cc", + "command_buffer/tests/occlusion_query_unittest.cc", + ] + + defines = [ + "GLES2_C_LIB_IMPLEMENTATION", + "GL_GLEXT_PROTOTYPES", + ] + + deps = [ + ":gpu", + ":gpu_unittest_utils", + "//base", + "//base/third_party/dynamic_annotations", + "//testing/gmock", + "//testing/gtest", + # TODO(GYP) + #"<(angle_path)/src/build_angle.gyp:translator", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gl", + #"//gpu/command_buffer/client", # These are all part of //gpu, needed? + #"//gpu/command_buffer/common", + #"//gpu/command_buffer/service", + #"//gpu/command_buffer/client:gles2_cmd_helper", + "//gpu/command_buffer/client:gles2_c_lib", + "//gpu/command_buffer/client:gles2_implementation_client_side_arrays", + ] + + # TODO(GYP) + # ['OS == "android"', { + # 'dependencies': [ + # '../testing/android/native_test.gyp:native_test_native_code', + # ], + # }], + # ['OS == "win"', { + # 'dependencies': [ + # '../third_party/angle/src/build_angle.gyp:libEGL', + # '../third_party/angle/src/build_angle.gyp:libGLESv2', + # ], + # }], +} +} # if (false) + +# TODO(GYP) +# gl_tests_apk +# gpu_unittests_apk diff --git a/gpu/command_buffer/client/BUILD.gn b/gpu/command_buffer/client/BUILD.gn index 910af3cd9e241d..535bb4913327ae 100644 --- a/gpu/command_buffer/client/BUILD.gn +++ b/gpu/command_buffer/client/BUILD.gn @@ -52,36 +52,40 @@ gles2_c_lib_source_files = [ "gles2_lib.cc", ] +gles2_implementation_source_files = [ + "buffer_tracker.cc", + "buffer_tracker.h", + "client_context_state.h", + "client_context_state.cc", + "client_context_state_autogen.h", + "client_context_state_impl_autogen.h", + "gles2_impl_export.h", + "gles2_implementation_autogen.h", + "gles2_implementation.cc", + "gles2_implementation.h", + "gles2_implementation_impl_autogen.h", + "gles2_interface.h", + "gles2_trace_implementation_autogen.h", + "gles2_trace_implementation.cc", + "gles2_trace_implementation.h", + "gles2_trace_implementation_impl_autogen.h", + "gpu_memory_buffer_factory.h", + "gpu_memory_buffer_tracker.cc", + "gpu_memory_buffer_tracker.h", + "program_info_manager.cc", + "program_info_manager.h", + "query_tracker.cc", + "query_tracker.h", + "share_group.cc", + "share_group.h", + "vertex_array_object_manager.cc", + "vertex_array_object_manager.h", +] + +# Library emulates GLES2 using command_buffers. component("gles2_implementation") { - sources = [ - "buffer_tracker.cc", - "buffer_tracker.h", - "client_context_state.h", - "client_context_state.cc", - "client_context_state_autogen.h", - "client_context_state_impl_autogen.h", - "gles2_impl_export.h", - "gles2_implementation_autogen.h", - "gles2_implementation.cc", - "gles2_implementation.h", - "gles2_implementation_impl_autogen.h", - "gles2_interface.h", - "gles2_trace_implementation_autogen.h", - "gles2_trace_implementation.cc", - "gles2_trace_implementation.h", - "gles2_trace_implementation_impl_autogen.h", - "gpu_memory_buffer_factory.h", - "gpu_memory_buffer_tracker.cc", - "gpu_memory_buffer_tracker.h", - "program_info_manager.cc", - "program_info_manager.h", - "query_tracker.cc", - "query_tracker.h", - "share_group.cc", - "share_group.h", - "vertex_array_object_manager.cc", - "vertex_array_object_manager.h", - ] + sources = gles2_implementation_source_files + defines = [ "GLES2_IMPL_IMPLEMENTATION" ] all_dependent_configs = [ "//third_party/khronos:khronos_headers" ] @@ -99,6 +103,49 @@ component("gles2_implementation") { ] } +# Library emulates GLES2 using command_buffers. +component("gles2_implementation_client_side_arrays") { + sources = gles2_implementation_source_files + + defines = [ + "GLES2_IMPL_IMPLEMENTATION", + "GLES2_SUPPORT_CLIENT_SIDE_ARRAYS=1", + ] + all_dependent_configs = [ "//third_party/khronos:khronos_headers" ] + + if (is_win) { + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + cflags = [ "/wd4267" ] # size_t to int truncation. + } + + deps = [ + ":gles2_cmd_helper", + "//base", + "//gpu/command_buffer/common", + "//ui/gfx/geometry", + "//ui/gl", + ] +} + +component("gl_in_process_context") { + sources = [ + "gl_in_process_context.h", + "gl_in_process_context.cc", + "gl_in_process_context_export.h", + ] + + defines = [ "GL_IN_PROCESS_CONTEXT_IMPLEMENTATION" ] + + deps = [ + ":gles2_implementation", + "//gpu", + "//base", + "//base/third_party/dynamic_annotations", + "//ui/gfx/geometry", + "//ui/gl", + ] +} + component("gles2_c_lib") { sources = gles2_c_lib_source_files defines = [ "GLES2_C_LIB_IMPLEMENTATION" ] diff --git a/gpu/config/BUILD.gn b/gpu/config/BUILD.gn new file mode 100644 index 00000000000000..9ace1237a397af --- /dev/null +++ b/gpu/config/BUILD.gn @@ -0,0 +1,69 @@ +# Copyright 2014 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/ui.gni") + +source_set("config") { + sources = [ + "dx_diag_node.cc", + "dx_diag_node.h", + "gpu_blacklist.cc", + "gpu_blacklist.h", + "gpu_control_list_jsons.h", + "gpu_control_list.cc", + "gpu_control_list.h", + "gpu_driver_bug_list_json.cc", + "gpu_driver_bug_list.cc", + "gpu_driver_bug_list.h", + "gpu_driver_bug_workaround_type.h", + "gpu_dx_diagnostics_win.cc", + "gpu_feature_type.h", + "gpu_info.cc", + "gpu_info.h", + "gpu_info_collector_android.cc", + "gpu_info_collector_mac.mm", + "gpu_info_collector_ozone.cc", + "gpu_info_collector_win.cc", + "gpu_info_collector_x11.cc", + "gpu_info_collector.cc", + "gpu_info_collector.h", + "gpu_performance_stats.h", + "gpu_test_config.cc", + "gpu_test_config.h", + "gpu_test_expectations_parser.cc", + "gpu_test_expectations_parser.h", + "gpu_util.cc", + "gpu_util.h", + "software_rendering_list_json.cc", + ] + + deps = [ + "//base", + "//third_party/re2", + "//ui/gl", + ] + + if (is_win) { + deps += [ "//third_party/libxml" ] + libs = [ "dxguid.lib", "setupapi.lib" ] + + if (is_chrome_branded) { + sources += [ + "//third_party/amd/AmdCfxPxExt.h", + "//third_party/amd/amd_videocard_info_win.cc", + ] + } + } + if (is_linux && use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xext", + ] + deps += [ + "//build/config/linux:libpci", + "//third_party/libXNVCtrl", + ] + } +} + diff --git a/gpu/skia_bindings/BUILD.gn b/gpu/skia_bindings/BUILD.gn new file mode 100644 index 00000000000000..2bd2a44a3c4933 --- /dev/null +++ b/gpu/skia_bindings/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2014 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. + +source_set("skia_bindings") { + sources = [ + "gl_bindings_skia_cmd_buffer.cc", + "gl_bindings_skia_cmd_buffer.h", + ] + deps = [ + "//gpu/command_buffer/client:gles2_c_lib", + "//skia", + ] +} diff --git a/third_party/libXNVCtrl/BUILD.gn b/third_party/libXNVCtrl/BUILD.gn new file mode 100644 index 00000000000000..ef95a0dd37be5e --- /dev/null +++ b/third_party/libXNVCtrl/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 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. + +source_set("libXNVCtrl") { + sources = [ + "NVCtrl.c", + "NVCtrl.h", + "NVCtrlLib.h", + "nv_control.h", + ] +} diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn index 4fd99f4f9b56c6..d9382931427e0c 100644 --- a/ui/gl/BUILD.gn +++ b/ui/gl/BUILD.gn @@ -301,6 +301,28 @@ action("generate_gl_bindings") { ] } +config("gl_unittest_utils_config") { + include_dirs = [ gl_binding_output_dir ] +} + +source_set("gl_unittest_utils") { + sources = [ + "gl_mock.h", + "gl_mock.cc", + "$gl_binding_output_dir/gl_bindings_autogen_mock.cc", + "$gl_binding_output_dir/gl_bindings_autogen_mock.h", + "$gl_binding_output_dir/gl_mock_autogen_gl.h", + ] + + configs += [ "//third_party/khronos:khronos_headers" ] + direct_dependent_configs = [ ":gl_unittest_utils_config" ] + + deps = [ + ":gl", + "//testing/gmock", + ] +} + if (is_android) { generate_jni("gl_jni_headers") { sources = [