From 82b5d950824501a233e607c6b48e0f5bc8c7e0b1 Mon Sep 17 00:00:00 2001 From: chrishtr Date: Mon, 20 Mar 2017 11:25:33 -0700 Subject: [PATCH] Move classes in cc/debug but not in the debug component elsewhere. Most classes are moved to a new cc/benchmarks/ directory. Others are placed in cc/base/, except for two cases where the class depends on cc/layers/ or cc/tiles/ internals, in which case they are placed in the most logical of those two. TBR=vmpstr CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2760663002 Cr-Commit-Position: refs/heads/master@{#458130} --- cc/BUILD.gn | 60 ++++----- cc/animation/animation_host_perftest.cc | 2 +- cc/base/BUILD.gn | 4 + .../devtools_instrumentation.cc | 2 +- cc/{debug => base}/devtools_instrumentation.h | 127 ++++++++---------- cc/{debug => base}/lap_timer.cc | 18 ++- cc/{debug => base}/lap_timer.h | 10 +- cc/{debug => base}/ring_buffer.h | 33 ++--- cc/base/rtree_perftest.cc | 2 +- .../benchmark_instrumentation.cc | 2 +- .../benchmark_instrumentation.h | 13 +- .../invalidation_benchmark.cc | 5 +- .../invalidation_benchmark.h | 8 +- cc/{debug => benchmarks}/micro_benchmark.cc | 7 +- cc/{debug => benchmarks}/micro_benchmark.h | 6 +- .../micro_benchmark_controller.cc | 8 +- .../micro_benchmark_controller.h | 8 +- .../micro_benchmark_controller_impl.cc | 2 +- .../micro_benchmark_controller_impl.h | 8 +- .../micro_benchmark_controller_unittest.cc | 30 ++--- .../micro_benchmark_impl.cc | 6 +- .../micro_benchmark_impl.h | 6 +- .../rasterize_and_record_benchmark.cc | 9 +- .../rasterize_and_record_benchmark.h | 8 +- .../rasterize_and_record_benchmark_impl.cc | 7 +- .../rasterize_and_record_benchmark_impl.h | 8 +- .../unittest_only_benchmark.cc | 4 +- .../unittest_only_benchmark.h | 8 +- .../unittest_only_benchmark_impl.cc | 5 +- .../unittest_only_benchmark_impl.h | 8 +- cc/layers/heads_up_display_layer_impl.cc | 2 +- cc/layers/heads_up_display_layer_impl.h | 2 +- cc/layers/layer.cc | 2 +- cc/layers/layer.h | 2 +- cc/layers/layer_impl.cc | 2 +- cc/layers/layer_perftest.cc | 2 +- cc/layers/picture_layer.h | 4 +- cc/layers/picture_layer_impl.cc | 2 +- cc/layers/picture_layer_impl_perftest.cc | 2 +- cc/output/bsp_tree_perftest.cc | 2 +- cc/quads/draw_quad_perftest.cc | 2 +- cc/raster/raster_buffer_provider_perftest.cc | 2 +- cc/raster/task_graph_runner_perftest.cc | 2 +- cc/raster/texture_compressor_perftest.cc | 2 +- cc/resources/memory_history.h | 2 +- cc/scheduler/scheduler.cc | 2 +- cc/surfaces/display.cc | 2 +- cc/surfaces/surface_aggregator_perftest.cc | 2 +- cc/test/fake_layer_tree_host.h | 2 +- .../frame_viewer_instrumentation.cc | 2 +- .../frame_viewer_instrumentation.h | 7 +- cc/tiles/gpu_image_decode_cache.cc | 2 +- cc/tiles/software_image_decode_cache.cc | 2 +- .../software_image_decode_cache_perftest.cc | 2 +- cc/tiles/tile_manager.cc | 4 +- cc/tiles/tile_manager_perftest.cc | 2 +- cc/{debug => trees}/debug_rect_history.cc | 27 ++-- cc/{debug => trees}/debug_rect_history.h | 12 +- cc/{debug => trees}/frame_rate_counter.cc | 17 +-- cc/{debug => trees}/frame_rate_counter.h | 8 +- cc/trees/layer_tree_host.cc | 4 +- cc/trees/layer_tree_host.h | 4 +- cc/trees/layer_tree_host_common_perftest.cc | 2 +- cc/trees/layer_tree_host_impl.cc | 10 +- cc/trees/layer_tree_host_impl.h | 2 +- cc/trees/layer_tree_host_perftest.cc | 2 +- cc/trees/layer_tree_host_unittest.cc | 2 +- cc/trees/layer_tree_impl.cc | 2 +- cc/trees/proxy_impl.cc | 4 +- cc/trees/proxy_main.cc | 4 +- cc/trees/single_thread_proxy.cc | 4 +- .../renderer/gpu/render_widget_compositor.cc | 2 +- 72 files changed, 272 insertions(+), 319 deletions(-) rename cc/{debug => base}/devtools_instrumentation.cc (96%) rename cc/{debug => base}/devtools_instrumentation.h (53%) rename cc/{debug => base}/lap_timer.cc (87%) rename cc/{debug => base}/lap_timer.h (93%) rename cc/{debug => base}/ring_buffer.h (81%) rename cc/{debug => benchmarks}/benchmark_instrumentation.cc (95%) rename cc/{debug => benchmarks}/benchmark_instrumentation.h (81%) rename cc/{debug => benchmarks}/invalidation_benchmark.cc (97%) rename cc/{debug => benchmarks}/invalidation_benchmark.h (85%) rename cc/{debug => benchmarks}/micro_benchmark.cc (93%) rename cc/{debug => benchmarks}/micro_benchmark.h (91%) rename cc/{debug => benchmarks}/micro_benchmark_controller.cc (94%) rename cc/{debug => benchmarks}/micro_benchmark_controller.h (86%) rename cc/{debug => benchmarks}/micro_benchmark_controller_impl.cc (95%) rename cc/{debug => benchmarks}/micro_benchmark_controller_impl.h (77%) rename cc/{debug => benchmarks}/micro_benchmark_controller_unittest.cc (88%) rename cc/{debug => benchmarks}/micro_benchmark_impl.cc (92%) rename cc/{debug => benchmarks}/micro_benchmark_impl.h (88%) rename cc/{debug => benchmarks}/rasterize_and_record_benchmark.cc (97%) rename cc/{debug => benchmarks}/rasterize_and_record_benchmark.h (88%) rename cc/{debug => benchmarks}/rasterize_and_record_benchmark_impl.cc (98%) rename cc/{debug => benchmarks}/rasterize_and_record_benchmark_impl.h (85%) rename cc/{debug => benchmarks}/unittest_only_benchmark.cc (94%) rename cc/{debug => benchmarks}/unittest_only_benchmark.h (82%) rename cc/{debug => benchmarks}/unittest_only_benchmark_impl.cc (84%) rename cc/{debug => benchmarks}/unittest_only_benchmark_impl.h (76%) rename cc/{debug => tiles}/frame_viewer_instrumentation.cc (98%) rename cc/{debug => tiles}/frame_viewer_instrumentation.h (85%) rename cc/{debug => trees}/debug_rect_history.cc (91%) rename cc/{debug => trees}/debug_rect_history.h (91%) rename cc/{debug => trees}/frame_rate_counter.cc (93%) rename cc/{debug => trees}/frame_rate_counter.h (92%) diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 67ed133600a000..4d4b7dbe5d4850 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn @@ -7,38 +7,26 @@ import("//gpu/vulkan/features.gni") cc_component("cc") { sources = [ - # TODO(chrishtr): move these to cc/benchmarks/ - "debug/benchmark_instrumentation.cc", - "debug/benchmark_instrumentation.h", - "debug/debug_rect_history.cc", - "debug/debug_rect_history.h", - "debug/devtools_instrumentation.cc", - "debug/devtools_instrumentation.h", - "debug/frame_rate_counter.cc", - "debug/frame_rate_counter.h", - "debug/frame_viewer_instrumentation.cc", - "debug/frame_viewer_instrumentation.h", - "debug/invalidation_benchmark.cc", - "debug/invalidation_benchmark.h", - "debug/lap_timer.cc", - "debug/lap_timer.h", - "debug/micro_benchmark.cc", - "debug/micro_benchmark.h", - "debug/micro_benchmark_controller.cc", - "debug/micro_benchmark_controller.h", - "debug/micro_benchmark_controller_impl.cc", - "debug/micro_benchmark_controller_impl.h", - "debug/micro_benchmark_impl.cc", - "debug/micro_benchmark_impl.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/ring_buffer.h", - "debug/unittest_only_benchmark.cc", - "debug/unittest_only_benchmark.h", - "debug/unittest_only_benchmark_impl.cc", - "debug/unittest_only_benchmark_impl.h", + "benchmarks/benchmark_instrumentation.cc", + "benchmarks/benchmark_instrumentation.h", + "benchmarks/invalidation_benchmark.cc", + "benchmarks/invalidation_benchmark.h", + "benchmarks/micro_benchmark.cc", + "benchmarks/micro_benchmark.h", + "benchmarks/micro_benchmark_controller.cc", + "benchmarks/micro_benchmark_controller.h", + "benchmarks/micro_benchmark_controller_impl.cc", + "benchmarks/micro_benchmark_controller_impl.h", + "benchmarks/micro_benchmark_impl.cc", + "benchmarks/micro_benchmark_impl.h", + "benchmarks/rasterize_and_record_benchmark.cc", + "benchmarks/rasterize_and_record_benchmark.h", + "benchmarks/rasterize_and_record_benchmark_impl.cc", + "benchmarks/rasterize_and_record_benchmark_impl.h", + "benchmarks/unittest_only_benchmark.cc", + "benchmarks/unittest_only_benchmark.h", + "benchmarks/unittest_only_benchmark_impl.cc", + "benchmarks/unittest_only_benchmark_impl.h", "input/browser_controls_offset_manager.cc", "input/browser_controls_offset_manager.h", "input/browser_controls_offset_manager_client.h", @@ -358,6 +346,8 @@ cc_component("cc") { "tiles/decoded_image_tracker.h", "tiles/eviction_tile_priority_queue.cc", "tiles/eviction_tile_priority_queue.h", + "tiles/frame_viewer_instrumentation.cc", + "tiles/frame_viewer_instrumentation.h", "tiles/gpu_image_decode_cache.cc", "tiles/gpu_image_decode_cache.h", "tiles/image_controller.cc", @@ -405,12 +395,16 @@ cc_component("cc") { "trees/compositor_mode.h", "trees/damage_tracker.cc", "trees/damage_tracker.h", + "trees/debug_rect_history.cc", + "trees/debug_rect_history.h", "trees/draw_property_utils.cc", "trees/draw_property_utils.h", "trees/effect_node.cc", "trees/effect_node.h", "trees/element_id.cc", "trees/element_id.h", + "trees/frame_rate_counter.cc", + "trees/frame_rate_counter.h", "trees/latency_info_swap_promise_monitor.cc", "trees/latency_info_swap_promise_monitor.h", "trees/layer_tree_host.cc", @@ -714,7 +708,7 @@ cc_test("cc_unittests") { "base/spiral_iterator_unittest.cc", "base/tiling_data_unittest.cc", "base/unique_notifier_unittest.cc", - "debug/micro_benchmark_controller_unittest.cc", + "benchmarks/micro_benchmark_controller_unittest.cc", "debug/rendering_stats_unittest.cc", "input/browser_controls_offset_manager_unittest.cc", "input/scroll_state_unittest.cc", diff --git a/cc/animation/animation_host_perftest.cc b/cc/animation/animation_host_perftest.cc index 776a6872facfc6..4da56d006490fd 100644 --- a/cc/animation/animation_host_perftest.cc +++ b/cc/animation/animation_host_perftest.cc @@ -8,7 +8,7 @@ #include "cc/animation/animation_id_provider.h" #include "cc/animation/animation_player.h" #include "cc/animation/animation_timeline.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" diff --git a/cc/base/BUILD.gn b/cc/base/BUILD.gn index e155d841f09e28..db70d19adb3da7 100644 --- a/cc/base/BUILD.gn +++ b/cc/base/BUILD.gn @@ -14,6 +14,8 @@ component("base") { "contiguous_container.h", "delayed_unique_notifier.cc", "delayed_unique_notifier.h", + "devtools_instrumentation.cc", + "devtools_instrumentation.h", "filter_operation.cc", "filter_operation.h", "filter_operations.cc", @@ -24,6 +26,8 @@ component("base") { "index_rect.h", "invalidation_region.cc", "invalidation_region.h", + "lap_timer.cc", + "lap_timer.h", "list_container.h", "list_container_helper.cc", "list_container_helper.h", diff --git a/cc/debug/devtools_instrumentation.cc b/cc/base/devtools_instrumentation.cc similarity index 96% rename from cc/debug/devtools_instrumentation.cc rename to cc/base/devtools_instrumentation.cc index e5743405febcf0..010b16149f1459 100644 --- a/cc/debug/devtools_instrumentation.cc +++ b/cc/base/devtools_instrumentation.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" namespace cc { namespace devtools_instrumentation { diff --git a/cc/debug/devtools_instrumentation.h b/cc/base/devtools_instrumentation.h similarity index 53% rename from cc/debug/devtools_instrumentation.h rename to cc/base/devtools_instrumentation.h index 3aa18632573a7d..40e2d9efd70885 100644 --- a/cc/debug/devtools_instrumentation.h +++ b/cc/base/devtools_instrumentation.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ -#define CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ +#ifndef CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ +#define CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ #include @@ -13,49 +13,49 @@ #include "base/metrics/histogram_macros.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" +#include "cc/base/base_export.h" namespace cc { namespace devtools_instrumentation { namespace internal { -extern const char kCategory[]; -extern const char kCategoryFrame[]; -extern const char kData[]; -extern const char kFrameId[]; -extern const char kLayerId[]; -extern const char kLayerTreeId[]; -extern const char kPixelRefId[]; - -extern const char kImageDecodeTask[]; -extern const char kBeginFrame[]; -extern const char kNeedsBeginFrameChanged[]; -extern const char kActivateLayerTree[]; -extern const char kRequestMainThreadFrame[]; -extern const char kBeginMainThreadFrame[]; -extern const char kDrawFrame[]; -extern const char kCompositeLayers[]; +CC_BASE_EXPORT extern const char kCategory[]; +CC_BASE_EXPORT extern const char kCategoryFrame[]; +CC_BASE_EXPORT extern const char kData[]; +CC_BASE_EXPORT extern const char kFrameId[]; +CC_BASE_EXPORT extern const char kLayerId[]; +CC_BASE_EXPORT extern const char kLayerTreeId[]; +CC_BASE_EXPORT extern const char kPixelRefId[]; + +CC_BASE_EXPORT extern const char kImageDecodeTask[]; +CC_BASE_EXPORT extern const char kBeginFrame[]; +CC_BASE_EXPORT extern const char kNeedsBeginFrameChanged[]; +CC_BASE_EXPORT extern const char kActivateLayerTree[]; +CC_BASE_EXPORT extern const char kRequestMainThreadFrame[]; +CC_BASE_EXPORT extern const char kBeginMainThreadFrame[]; +CC_BASE_EXPORT extern const char kDrawFrame[]; +CC_BASE_EXPORT extern const char kCompositeLayers[]; } // namespace internal extern const char kPaintSetup[]; -extern const char kUpdateLayer[]; +CC_BASE_EXPORT extern const char kUpdateLayer[]; -class ScopedLayerTask { +class CC_BASE_EXPORT ScopedLayerTask { public: ScopedLayerTask(const char* event_name, int layer_id) - : event_name_(event_name) { - TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, - internal::kLayerId, layer_id); - } - ~ScopedLayerTask() { - TRACE_EVENT_END0(internal::kCategory, event_name_); + : event_name_(event_name) { + TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, internal::kLayerId, + layer_id); } + ~ScopedLayerTask() { TRACE_EVENT_END0(internal::kCategory, event_name_); } + private: const char* event_name_; DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask); }; -class ScopedImageDecodeTask { +class CC_BASE_EXPORT ScopedImageDecodeTask { public: enum Type { SOFTWARE, GPU }; @@ -86,26 +86,24 @@ class ScopedImageDecodeTask { DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); }; -class ScopedLayerTreeTask { +class CC_BASE_EXPORT ScopedLayerTreeTask { public: ScopedLayerTreeTask(const char* event_name, int layer_id, int layer_tree_host_id) - : event_name_(event_name) { - TRACE_EVENT_BEGIN2(internal::kCategory, event_name_, - internal::kLayerId, layer_id, - internal::kLayerTreeId, layer_tree_host_id); - } - ~ScopedLayerTreeTask() { - TRACE_EVENT_END0(internal::kCategory, event_name_); + : event_name_(event_name) { + TRACE_EVENT_BEGIN2(internal::kCategory, event_name_, internal::kLayerId, + layer_id, internal::kLayerTreeId, layer_tree_host_id); } + ~ScopedLayerTreeTask() { TRACE_EVENT_END0(internal::kCategory, event_name_); } + private: const char* event_name_; DISALLOW_COPY_AND_ASSIGN(ScopedLayerTreeTask); }; -struct ScopedCommitTrace { +struct CC_BASE_EXPORT ScopedCommitTrace { public: explicit ScopedCommitTrace(int layer_tree_host_id) { TRACE_EVENT_BEGIN1(internal::kCategory, internal::kCompositeLayers, @@ -119,51 +117,40 @@ struct ScopedCommitTrace { DISALLOW_COPY_AND_ASSIGN(ScopedCommitTrace); }; -struct ScopedLayerObjectTracker +struct CC_BASE_EXPORT ScopedLayerObjectTracker : public base::trace_event::TraceScopedTrackableObject { explicit ScopedLayerObjectTracker(int layer_id) - : base::trace_event::TraceScopedTrackableObject( - internal::kCategory, - internal::kLayerId, - layer_id) { - } + : base::trace_event::TraceScopedTrackableObject(internal::kCategory, + internal::kLayerId, + layer_id) {} private: DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker); }; -inline void DidActivateLayerTree(int layer_tree_host_id, int frame_id) { - TRACE_EVENT_INSTANT2(internal::kCategoryFrame, - internal::kActivateLayerTree, - TRACE_EVENT_SCOPE_THREAD, - internal::kLayerTreeId, - layer_tree_host_id, - internal::kFrameId, - frame_id); +inline void CC_BASE_EXPORT DidActivateLayerTree(int layer_tree_host_id, + int frame_id) { + TRACE_EVENT_INSTANT2(internal::kCategoryFrame, internal::kActivateLayerTree, + TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, + layer_tree_host_id, internal::kFrameId, frame_id); } -inline void DidBeginFrame(int layer_tree_host_id) { - TRACE_EVENT_INSTANT1(internal::kCategoryFrame, - internal::kBeginFrame, - TRACE_EVENT_SCOPE_THREAD, - internal::kLayerTreeId, +inline void CC_BASE_EXPORT DidBeginFrame(int layer_tree_host_id) { + TRACE_EVENT_INSTANT1(internal::kCategoryFrame, internal::kBeginFrame, + TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id); } -inline void DidDrawFrame(int layer_tree_host_id) { - TRACE_EVENT_INSTANT1(internal::kCategoryFrame, - internal::kDrawFrame, - TRACE_EVENT_SCOPE_THREAD, - internal::kLayerTreeId, +inline void CC_BASE_EXPORT DidDrawFrame(int layer_tree_host_id) { + TRACE_EVENT_INSTANT1(internal::kCategoryFrame, internal::kDrawFrame, + TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id); } -inline void DidRequestMainThreadFrame(int layer_tree_host_id) { - TRACE_EVENT_INSTANT1(internal::kCategoryFrame, - internal::kRequestMainThreadFrame, - TRACE_EVENT_SCOPE_THREAD, - internal::kLayerTreeId, - layer_tree_host_id); +inline void CC_BASE_EXPORT DidRequestMainThreadFrame(int layer_tree_host_id) { + TRACE_EVENT_INSTANT1( + internal::kCategoryFrame, internal::kRequestMainThreadFrame, + TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id); } inline std::unique_ptr @@ -174,7 +161,8 @@ BeginMainThreadFrameData(int frame_id) { return std::move(value); } -inline void WillBeginMainThreadFrame(int layer_tree_host_id, int frame_id) { +inline void CC_BASE_EXPORT WillBeginMainThreadFrame(int layer_tree_host_id, + int frame_id) { TRACE_EVENT_INSTANT2( internal::kCategoryFrame, internal::kBeginMainThreadFrame, TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id, @@ -189,7 +177,8 @@ NeedsBeginFrameData(bool needs_begin_frame) { return std::move(value); } -inline void NeedsBeginFrameChanged(int layer_tree_host_id, bool new_value) { +inline void CC_BASE_EXPORT NeedsBeginFrameChanged(int layer_tree_host_id, + bool new_value) { TRACE_EVENT_INSTANT2( internal::kCategoryFrame, internal::kNeedsBeginFrameChanged, TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id, @@ -199,4 +188,4 @@ inline void NeedsBeginFrameChanged(int layer_tree_host_id, bool new_value) { } // namespace devtools_instrumentation } // namespace cc -#endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ +#endif // CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ diff --git a/cc/debug/lap_timer.cc b/cc/base/lap_timer.cc similarity index 87% rename from cc/debug/lap_timer.cc rename to cc/base/lap_timer.cc index 2c5d3810b399a6..6702311f6d449d 100644 --- a/cc/debug/lap_timer.cc +++ b/cc/base/lap_timer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "base/logging.h" @@ -58,7 +58,9 @@ void LapTimer::Start() { start_time_ = Now(); } -bool LapTimer::IsWarmedUp() { return remaining_warmups_ <= 0; } +bool LapTimer::IsWarmedUp() { + return remaining_warmups_ <= 0; +} void LapTimer::NextLap() { if (!IsWarmedUp()) { @@ -78,9 +80,13 @@ void LapTimer::NextLap() { } } -bool LapTimer::HasTimeLimitExpired() { return accumulator_ >= time_limit_; } +bool LapTimer::HasTimeLimitExpired() { + return accumulator_ >= time_limit_; +} -bool LapTimer::HasTimedAllLaps() { return !(num_laps_ % check_interval_); } +bool LapTimer::HasTimedAllLaps() { + return !(num_laps_ % check_interval_); +} float LapTimer::MsPerLap() { DCHECK(HasTimedAllLaps()); @@ -92,6 +98,8 @@ float LapTimer::LapsPerSecond() { return num_laps_ / accumulator_.InSecondsF(); } -int LapTimer::NumLaps() { return num_laps_; } +int LapTimer::NumLaps() { + return num_laps_; +} } // namespace cc diff --git a/cc/debug/lap_timer.h b/cc/base/lap_timer.h similarity index 93% rename from cc/debug/lap_timer.h rename to cc/base/lap_timer.h index bdba8accfe9e93..5b27e2578547b7 100644 --- a/cc/debug/lap_timer.h +++ b/cc/base/lap_timer.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_LAP_TIMER_H_ -#define CC_DEBUG_LAP_TIMER_H_ +#ifndef CC_BASE_LAP_TIMER_H_ +#define CC_BASE_LAP_TIMER_H_ #include "base/macros.h" #include "base/time/time.h" -#include "cc/cc_export.h" +#include "cc/base/base_export.h" namespace cc { @@ -21,7 +21,7 @@ namespace cc { // If you set the time_limit then you can use HasTimeLimitExpired() to see if // the current accumulated time has crossed that threshold, with an optimization // that it only tests this every check_interval laps. -class CC_EXPORT LapTimer { +class CC_BASE_EXPORT LapTimer { public: LapTimer(int warmup_laps, base::TimeDelta time_limit, int check_interval); // Create LapTimer with sensible default values. @@ -64,4 +64,4 @@ class CC_EXPORT LapTimer { } // namespace cc -#endif // CC_DEBUG_LAP_TIMER_H_ +#endif // CC_BASE_LAP_TIMER_H_ diff --git a/cc/debug/ring_buffer.h b/cc/base/ring_buffer.h similarity index 81% rename from cc/debug/ring_buffer.h rename to cc/base/ring_buffer.h index 5f7d49ae62e51f..e4b03cb449e6ad 100644 --- a/cc/debug/ring_buffer.h +++ b/cc/base/ring_buffer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_RING_BUFFER_H_ -#define CC_DEBUG_RING_BUFFER_H_ +#ifndef CC_BASE_RING_BUFFER_H_ +#define CC_BASE_RING_BUFFER_H_ #include @@ -12,23 +12,17 @@ namespace cc { -template +template class RingBuffer { public: RingBuffer() : current_index_(0) {} - size_t BufferSize() const { - return kSize; - } + size_t BufferSize() const { return kSize; } - size_t CurrentIndex() const { - return current_index_; - } + size_t CurrentIndex() const { return current_index_; } // tests if a value was saved to this index - bool IsFilledIndex(size_t n) const { - return BufferIndex(n) < current_index_; - } + bool IsFilledIndex(size_t n) const { return BufferIndex(n) < current_index_; } // n = 0 returns the oldest value and // n = bufferSize() - 1 returns the most recent value. @@ -47,9 +41,7 @@ class RingBuffer { current_index_++; } - void Clear() { - current_index_ = 0; - } + void Clear() { current_index_ = 0; } // Iterator has const access to the RingBuffer it got retrieved from. class Iterator { @@ -79,10 +71,7 @@ class RingBuffer { private: Iterator(const RingBuffer& buffer, size_t index) - : buffer_(buffer), - index_(index), - out_of_range_(false) { - } + : buffer_(buffer), index_(index), out_of_range_(false) {} const RingBuffer& buffer_; size_t index_; @@ -103,9 +92,7 @@ class RingBuffer { // Returns an Iterator pointing to the newest value in the buffer. // Example usage (iterate backwards from newest to oldest value): // for (RingBuffer::Iterator it = ring_buffer.End(); it; --it) {} - Iterator End() const { - return Iterator(*this, kSize - 1); - } + Iterator End() const { return Iterator(*this, kSize - 1); } private: inline size_t BufferIndex(size_t n) const { @@ -120,4 +107,4 @@ class RingBuffer { } // namespace cc -#endif // CC_DEBUG_RING_BUFFER_H_ +#endif // CC_BASE_RING_BUFFER_H_ diff --git a/cc/base/rtree_perftest.cc b/cc/base/rtree_perftest.cc index 85aee076691776..d18d0f66fdf827 100644 --- a/cc/base/rtree_perftest.cc +++ b/cc/base/rtree_perftest.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "cc/base/lap_timer.h" #include "cc/base/rtree.h" -#include "cc/debug/lap_timer.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/perf/perf_test.h" diff --git a/cc/debug/benchmark_instrumentation.cc b/cc/benchmarks/benchmark_instrumentation.cc similarity index 95% rename from cc/debug/benchmark_instrumentation.cc rename to cc/benchmarks/benchmark_instrumentation.cc index ff2217154f43b2..5674c2feaf3a75 100644 --- a/cc/debug/benchmark_instrumentation.cc +++ b/cc/benchmarks/benchmark_instrumentation.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "cc/benchmarks/benchmark_instrumentation.h" #include "base/trace_event/trace_event.h" -#include "cc/debug/benchmark_instrumentation.h" namespace cc { namespace benchmark_instrumentation { diff --git a/cc/debug/benchmark_instrumentation.h b/cc/benchmarks/benchmark_instrumentation.h similarity index 81% rename from cc/debug/benchmark_instrumentation.h rename to cc/benchmarks/benchmark_instrumentation.h index 6e8ac6b1fb0575..9b5e5efef977c4 100644 --- a/cc/debug/benchmark_instrumentation.h +++ b/cc/benchmarks/benchmark_instrumentation.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_BENCHMARK_INSTRUMENTATION_H_ -#define CC_DEBUG_BENCHMARK_INSTRUMENTATION_H_ +#ifndef CC_BENCHMARKS_BENCHMARK_INSTRUMENTATION_H_ +#define CC_BENCHMARKS_BENCHMARK_INSTRUMENTATION_H_ #include "base/macros.h" +#include "base/trace_event/trace_event.h" #include "cc/cc_export.h" #include "cc/debug/rendering_stats.h" @@ -30,10 +31,8 @@ class ScopedBeginFrameTask { public: ScopedBeginFrameTask(const char* event_name, unsigned int begin_frame_id) : event_name_(event_name) { - TRACE_EVENT_BEGIN1(internal::kCategory, - event_name_, - internal::kBeginFrameId, - begin_frame_id); + TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, + internal::kBeginFrameId, begin_frame_id); } ~ScopedBeginFrameTask() { TRACE_EVENT_END0(internal::kCategory, event_name_); @@ -51,4 +50,4 @@ void CC_EXPORT IssueDisplayRenderingStatsEvent(); } // namespace benchmark_instrumentation } // namespace cc -#endif // CC_DEBUG_BENCHMARK_INSTRUMENTATION_H_ +#endif // CC_BENCHMARKS_BENCHMARK_INSTRUMENTATION_H_ diff --git a/cc/debug/invalidation_benchmark.cc b/cc/benchmarks/invalidation_benchmark.cc similarity index 97% rename from cc/debug/invalidation_benchmark.cc rename to cc/benchmarks/invalidation_benchmark.cc index 6e6d343389d0e0..89f5973feb9f69 100644 --- a/cc/debug/invalidation_benchmark.cc +++ b/cc/benchmarks/invalidation_benchmark.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/invalidation_benchmark.h" +#include "cc/benchmarks/invalidation_benchmark.h" #include @@ -60,8 +60,7 @@ InvalidationBenchmark::InvalidationBenchmark( } } -InvalidationBenchmark::~InvalidationBenchmark() { -} +InvalidationBenchmark::~InvalidationBenchmark() {} void InvalidationBenchmark::DidUpdateLayers(LayerTreeHost* layer_tree_host) { LayerTreeHostCommon::CallFunctionForEveryLayer( diff --git a/cc/debug/invalidation_benchmark.h b/cc/benchmarks/invalidation_benchmark.h similarity index 85% rename from cc/debug/invalidation_benchmark.h rename to cc/benchmarks/invalidation_benchmark.h index a04663d64f0811..b9fbb727bb05f3 100644 --- a/cc/debug/invalidation_benchmark.h +++ b/cc/benchmarks/invalidation_benchmark.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_INVALIDATION_BENCHMARK_H_ -#define CC_DEBUG_INVALIDATION_BENCHMARK_H_ +#ifndef CC_BENCHMARKS_INVALIDATION_BENCHMARK_H_ +#define CC_BENCHMARKS_INVALIDATION_BENCHMARK_H_ #include #include -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" namespace cc { @@ -43,4 +43,4 @@ class CC_EXPORT InvalidationBenchmark : public MicroBenchmark { } // namespace cc -#endif // CC_DEBUG_INVALIDATION_BENCHMARK_H_ +#endif // CC_BENCHMARKS_INVALIDATION_BENCHMARK_H_ diff --git a/cc/debug/micro_benchmark.cc b/cc/benchmarks/micro_benchmark.cc similarity index 93% rename from cc/debug/micro_benchmark.cc rename to cc/benchmarks/micro_benchmark.cc index 4bbca390a47390..456431bd79dcc7 100644 --- a/cc/debug/micro_benchmark.cc +++ b/cc/benchmarks/micro_benchmark.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/micro_benchmark.h" +#include "cc/benchmarks/micro_benchmark.h" #include @@ -11,7 +11,7 @@ #include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/values.h" -#include "cc/debug/micro_benchmark_impl.h" +#include "cc/benchmarks/micro_benchmark_impl.h" namespace cc { @@ -19,8 +19,7 @@ MicroBenchmark::MicroBenchmark(const DoneCallback& callback) : callback_(callback), is_done_(false), processed_for_benchmark_impl_(false), - id_(0) { -} + id_(0) {} MicroBenchmark::~MicroBenchmark() {} diff --git a/cc/debug/micro_benchmark.h b/cc/benchmarks/micro_benchmark.h similarity index 91% rename from cc/debug/micro_benchmark.h rename to cc/benchmarks/micro_benchmark.h index 80302b76113f54..5ffadc0d0a0077 100644 --- a/cc/debug/micro_benchmark.h +++ b/cc/benchmarks/micro_benchmark.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_MICRO_BENCHMARK_H_ -#define CC_DEBUG_MICRO_BENCHMARK_H_ +#ifndef CC_BENCHMARKS_MICRO_BENCHMARK_H_ +#define CC_BENCHMARKS_MICRO_BENCHMARK_H_ #include @@ -57,4 +57,4 @@ class CC_EXPORT MicroBenchmark { } // namespace cc -#endif // CC_DEBUG_MICRO_BENCHMARK_H_ +#endif // CC_BENCHMARKS_MICRO_BENCHMARK_H_ diff --git a/cc/debug/micro_benchmark_controller.cc b/cc/benchmarks/micro_benchmark_controller.cc similarity index 94% rename from cc/debug/micro_benchmark_controller.cc rename to cc/benchmarks/micro_benchmark_controller.cc index 3a7219404e3e49..f55a607c7ab538 100644 --- a/cc/debug/micro_benchmark_controller.cc +++ b/cc/benchmarks/micro_benchmark_controller.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include #include @@ -12,9 +12,9 @@ #include "base/stl_util.h" #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" -#include "cc/debug/invalidation_benchmark.h" -#include "cc/debug/rasterize_and_record_benchmark.h" -#include "cc/debug/unittest_only_benchmark.h" +#include "cc/benchmarks/invalidation_benchmark.h" +#include "cc/benchmarks/rasterize_and_record_benchmark.h" +#include "cc/benchmarks/unittest_only_benchmark.h" #include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_host_impl.h" diff --git a/cc/debug/micro_benchmark_controller.h b/cc/benchmarks/micro_benchmark_controller.h similarity index 86% rename from cc/debug/micro_benchmark_controller.h rename to cc/benchmarks/micro_benchmark_controller.h index 88ccc840ab53aa..0f38800241cd1a 100644 --- a/cc/debug/micro_benchmark_controller.h +++ b/cc/benchmarks/micro_benchmark_controller.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_ -#define CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_ +#ifndef CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_H_ +#define CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_H_ #include #include #include "base/callback.h" #include "base/macros.h" -#include "cc/debug/micro_benchmark.h" +#include "cc/benchmarks/micro_benchmark.h" namespace base { class SingleThreadTaskRunner; @@ -51,4 +51,4 @@ class CC_EXPORT MicroBenchmarkController { } // namespace cc -#endif // CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_ +#endif // CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_H_ diff --git a/cc/debug/micro_benchmark_controller_impl.cc b/cc/benchmarks/micro_benchmark_controller_impl.cc similarity index 95% rename from cc/debug/micro_benchmark_controller_impl.cc rename to cc/benchmarks/micro_benchmark_controller_impl.cc index e02b76d1839dc0..2e53c451539759 100644 --- a/cc/debug/micro_benchmark_controller_impl.cc +++ b/cc/benchmarks/micro_benchmark_controller_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/micro_benchmark_controller_impl.h" +#include "cc/benchmarks/micro_benchmark_controller_impl.h" #include diff --git a/cc/debug/micro_benchmark_controller_impl.h b/cc/benchmarks/micro_benchmark_controller_impl.h similarity index 77% rename from cc/debug/micro_benchmark_controller_impl.h rename to cc/benchmarks/micro_benchmark_controller_impl.h index 67c8005059aa7c..794824364865ea 100644 --- a/cc/debug/micro_benchmark_controller_impl.h +++ b/cc/benchmarks/micro_benchmark_controller_impl.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ -#define CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ +#ifndef CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ +#define CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ #include #include #include "base/macros.h" -#include "cc/debug/micro_benchmark_impl.h" +#include "cc/benchmarks/micro_benchmark_impl.h" namespace cc { @@ -34,4 +34,4 @@ class CC_EXPORT MicroBenchmarkControllerImpl { } // namespace cc -#endif // CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ +#endif // CC_BENCHMARKS_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/benchmarks/micro_benchmark_controller_unittest.cc similarity index 88% rename from cc/debug/micro_benchmark_controller_unittest.cc rename to cc/benchmarks/micro_benchmark_controller_unittest.cc index 4a6ce7e50ee057..08f3de6e50c22c 100644 --- a/cc/debug/micro_benchmark_controller_unittest.cc +++ b/cc/benchmarks/micro_benchmark_controller_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include @@ -10,7 +10,7 @@ #include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "cc/animation/animation_host.h" -#include "cc/debug/micro_benchmark.h" +#include "cc/benchmarks/micro_benchmark.h" #include "cc/layers/layer.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host.h" @@ -61,15 +61,15 @@ void IncrementCallCount(int* count, std::unique_ptr value) { } TEST_F(MicroBenchmarkControllerTest, ScheduleFail) { - int id = layer_tree_host_->ScheduleMicroBenchmark( - "non_existant_benchmark", nullptr, base::Bind(&Noop)); + int id = layer_tree_host_->ScheduleMicroBenchmark("non_existant_benchmark", + nullptr, base::Bind(&Noop)); EXPECT_EQ(id, 0); } TEST_F(MicroBenchmarkControllerTest, CommitScheduled) { EXPECT_FALSE(layer_tree_host_->needs_commit()); - int id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", nullptr, base::Bind(&Noop)); + int id = layer_tree_host_->ScheduleMicroBenchmark("unittest_only_benchmark", + nullptr, base::Bind(&Noop)); EXPECT_GT(id, 0); EXPECT_TRUE(layer_tree_host_->needs_commit()); } @@ -77,8 +77,7 @@ TEST_F(MicroBenchmarkControllerTest, CommitScheduled) { TEST_F(MicroBenchmarkControllerTest, BenchmarkRan) { int run_count = 0; int id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); @@ -90,13 +89,11 @@ TEST_F(MicroBenchmarkControllerTest, BenchmarkRan) { TEST_F(MicroBenchmarkControllerTest, MultipleBenchmarkRan) { int run_count = 0; int id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); @@ -105,13 +102,11 @@ TEST_F(MicroBenchmarkControllerTest, MultipleBenchmarkRan) { EXPECT_EQ(2, run_count); id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); @@ -157,8 +152,7 @@ TEST_F(MicroBenchmarkControllerTest, SendMessage) { // Schedule a benchmark int run_count = 0; int id = layer_tree_host_->ScheduleMicroBenchmark( - "unittest_only_benchmark", - nullptr, + "unittest_only_benchmark", nullptr, base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); diff --git a/cc/debug/micro_benchmark_impl.cc b/cc/benchmarks/micro_benchmark_impl.cc similarity index 92% rename from cc/debug/micro_benchmark_impl.cc rename to cc/benchmarks/micro_benchmark_impl.cc index 8f818fd16eae89..d660645336b429 100644 --- a/cc/debug/micro_benchmark_impl.cc +++ b/cc/benchmarks/micro_benchmark_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/micro_benchmark_impl.h" +#include "cc/benchmarks/micro_benchmark_impl.h" #include @@ -20,7 +20,6 @@ void RunCallback(const MicroBenchmarkImpl::DoneCallback& callback, std::unique_ptr result) { callback.Run(std::move(result)); } - } MicroBenchmarkImpl::MicroBenchmarkImpl( @@ -28,8 +27,7 @@ MicroBenchmarkImpl::MicroBenchmarkImpl( scoped_refptr origin_task_runner) : callback_(callback), is_done_(false), - origin_task_runner_(origin_task_runner) { -} + origin_task_runner_(origin_task_runner) {} MicroBenchmarkImpl::~MicroBenchmarkImpl() {} diff --git a/cc/debug/micro_benchmark_impl.h b/cc/benchmarks/micro_benchmark_impl.h similarity index 88% rename from cc/debug/micro_benchmark_impl.h rename to cc/benchmarks/micro_benchmark_impl.h index dbbecd85f1d389..d13ba4f97edb36 100644 --- a/cc/debug/micro_benchmark_impl.h +++ b/cc/benchmarks/micro_benchmark_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ -#define CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ +#ifndef CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_ +#define CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_ #include @@ -46,4 +46,4 @@ class CC_EXPORT MicroBenchmarkImpl { } // namespace cc -#endif // CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ +#endif // CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_ diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/benchmarks/rasterize_and_record_benchmark.cc similarity index 97% rename from cc/debug/rasterize_and_record_benchmark.cc rename to cc/benchmarks/rasterize_and_record_benchmark.cc index 0e13b01577c8fc..6314fdef87ea45 100644 --- a/cc/debug/rasterize_and_record_benchmark.cc +++ b/cc/benchmarks/rasterize_and_record_benchmark.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/rasterize_and_record_benchmark.h" +#include "cc/benchmarks/rasterize_and_record_benchmark.h" #include @@ -13,8 +13,8 @@ #include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/values.h" -#include "cc/debug/lap_timer.h" -#include "cc/debug/rasterize_and_record_benchmark_impl.h" +#include "cc/base/lap_timer.h" +#include "cc/benchmarks/rasterize_and_record_benchmark_impl.h" #include "cc/layers/content_layer_client.h" #include "cc/layers/layer.h" #include "cc/layers/picture_layer.h" @@ -190,8 +190,7 @@ void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) { } RasterizeAndRecordBenchmark::RecordResults::RecordResults() - : pixels_recorded(0), bytes_used(0) { -} + : pixels_recorded(0), bytes_used(0) {} RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} diff --git a/cc/debug/rasterize_and_record_benchmark.h b/cc/benchmarks/rasterize_and_record_benchmark.h similarity index 88% rename from cc/debug/rasterize_and_record_benchmark.h rename to cc/benchmarks/rasterize_and_record_benchmark.h index d4ba6a659bff39..14871642af2967 100644 --- a/cc/debug/rasterize_and_record_benchmark.h +++ b/cc/benchmarks/rasterize_and_record_benchmark.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ -#define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ +#ifndef CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_H_ +#define CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_H_ #include @@ -14,7 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/time/time.h" -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include "cc/layers/recording_source.h" namespace base { @@ -66,4 +66,4 @@ class RasterizeAndRecordBenchmark : public MicroBenchmark { } // namespace cc -#endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ +#endif // CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_H_ diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/benchmarks/rasterize_and_record_benchmark_impl.cc similarity index 98% rename from cc/debug/rasterize_and_record_benchmark_impl.cc rename to cc/benchmarks/rasterize_and_record_benchmark_impl.cc index 1a1dfb64469eab..0144636664c6ee 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.cc +++ b/cc/benchmarks/rasterize_and_record_benchmark_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/rasterize_and_record_benchmark_impl.h" +#include "cc/benchmarks/rasterize_and_record_benchmark_impl.h" #include @@ -10,7 +10,7 @@ #include #include "base/values.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/layers/layer_impl.h" #include "cc/layers/picture_layer_impl.h" #include "cc/raster/raster_buffer_provider.h" @@ -218,8 +218,7 @@ RasterizeAndRecordBenchmarkImpl::RasterizeResults::RasterizeResults() total_layers(0), total_picture_layers(0), total_picture_layers_with_no_content(0), - total_picture_layers_off_screen(0) { -} + total_picture_layers_off_screen(0) {} RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} diff --git a/cc/debug/rasterize_and_record_benchmark_impl.h b/cc/benchmarks/rasterize_and_record_benchmark_impl.h similarity index 85% rename from cc/debug/rasterize_and_record_benchmark_impl.h rename to cc/benchmarks/rasterize_and_record_benchmark_impl.h index 6d25c8affc14ab..2804c0149ee48b 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.h +++ b/cc/benchmarks/rasterize_and_record_benchmark_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ -#define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ +#ifndef CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ +#define CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ #include @@ -13,7 +13,7 @@ #include "base/single_thread_task_runner.h" #include "base/time/time.h" -#include "cc/debug/micro_benchmark_impl.h" +#include "cc/benchmarks/micro_benchmark_impl.h" #include "cc/raster/task_graph_runner.h" namespace cc { @@ -55,4 +55,4 @@ class RasterizeAndRecordBenchmarkImpl : public MicroBenchmarkImpl { } // namespace cc -#endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ +#endif // CC_BENCHMARKS_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ diff --git a/cc/debug/unittest_only_benchmark.cc b/cc/benchmarks/unittest_only_benchmark.cc similarity index 94% rename from cc/debug/unittest_only_benchmark.cc rename to cc/benchmarks/unittest_only_benchmark.cc index 321444d9aa840e..5ba8bcfe6f1ed8 100644 --- a/cc/debug/unittest_only_benchmark.cc +++ b/cc/benchmarks/unittest_only_benchmark.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/unittest_only_benchmark.h" +#include "cc/benchmarks/unittest_only_benchmark.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/values.h" -#include "cc/debug/unittest_only_benchmark_impl.h" +#include "cc/benchmarks/unittest_only_benchmark_impl.h" namespace cc { diff --git a/cc/debug/unittest_only_benchmark.h b/cc/benchmarks/unittest_only_benchmark.h similarity index 82% rename from cc/debug/unittest_only_benchmark.h rename to cc/benchmarks/unittest_only_benchmark.h index ffeaceb36600a2..277c4274dba5d1 100644 --- a/cc/debug/unittest_only_benchmark.h +++ b/cc/benchmarks/unittest_only_benchmark.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_UNITTEST_ONLY_BENCHMARK_H_ -#define CC_DEBUG_UNITTEST_ONLY_BENCHMARK_H_ +#ifndef CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_H_ +#define CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_H_ #include "base/memory/weak_ptr.h" -#include "cc/debug/micro_benchmark.h" +#include "cc/benchmarks/micro_benchmark.h" namespace cc { @@ -32,4 +32,4 @@ class CC_EXPORT UnittestOnlyBenchmark : public MicroBenchmark { } // namespace cc -#endif // CC_DEBUG_UNITTEST_ONLY_BENCHMARK_H_ +#endif // CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_H_ diff --git a/cc/debug/unittest_only_benchmark_impl.cc b/cc/benchmarks/unittest_only_benchmark_impl.cc similarity index 84% rename from cc/debug/unittest_only_benchmark_impl.cc rename to cc/benchmarks/unittest_only_benchmark_impl.cc index 59e3d274738206..7bad5474fd300e 100644 --- a/cc/debug/unittest_only_benchmark_impl.cc +++ b/cc/benchmarks/unittest_only_benchmark_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/unittest_only_benchmark_impl.h" +#include "cc/benchmarks/unittest_only_benchmark_impl.h" #include "base/single_thread_task_runner.h" #include "base/values.h" @@ -13,8 +13,7 @@ UnittestOnlyBenchmarkImpl::UnittestOnlyBenchmarkImpl( scoped_refptr origin_task_runner, base::Value* settings, const DoneCallback& callback) - : MicroBenchmarkImpl(callback, origin_task_runner) { -} + : MicroBenchmarkImpl(callback, origin_task_runner) {} UnittestOnlyBenchmarkImpl::~UnittestOnlyBenchmarkImpl() {} diff --git a/cc/debug/unittest_only_benchmark_impl.h b/cc/benchmarks/unittest_only_benchmark_impl.h similarity index 76% rename from cc/debug/unittest_only_benchmark_impl.h rename to cc/benchmarks/unittest_only_benchmark_impl.h index 1444850fb93035..a378b9e2592933 100644 --- a/cc/debug/unittest_only_benchmark_impl.h +++ b/cc/benchmarks/unittest_only_benchmark_impl.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_UNITTEST_ONLY_BENCHMARK_IMPL_H_ -#define CC_DEBUG_UNITTEST_ONLY_BENCHMARK_IMPL_H_ +#ifndef CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_IMPL_H_ +#define CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_IMPL_H_ #include "base/memory/weak_ptr.h" -#include "cc/debug/micro_benchmark_impl.h" +#include "cc/benchmarks/micro_benchmark_impl.h" namespace base { class SingleThreadTaskRunner; @@ -29,4 +29,4 @@ class CC_EXPORT UnittestOnlyBenchmarkImpl : public MicroBenchmarkImpl { } // namespace cc -#endif // CC_DEBUG_UNITTEST_ONLY_BENCHMARK_IMPL_H_ +#endif // CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_IMPL_H_ diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 050dcda782d19b..7340f184c1fa53 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -16,10 +16,10 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" #include "cc/debug/debug_colors.h" -#include "cc/debug/frame_rate_counter.h" #include "cc/output/begin_frame_args.h" #include "cc/quads/texture_draw_quad.h" #include "cc/resources/memory_history.h" +#include "cc/trees/frame_rate_counter.h" #include "cc/trees/layer_tree_host_impl.h" #include "cc/trees/layer_tree_impl.h" #include "skia/ext/platform_canvas.h" diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h index c7f0577c53118b..b808ebc911c127 100644 --- a/cc/layers/heads_up_display_layer_impl.h +++ b/cc/layers/heads_up_display_layer_impl.h @@ -13,10 +13,10 @@ #include "base/memory/ptr_util.h" #include "base/time/time.h" #include "cc/cc_export.h" -#include "cc/debug/debug_rect_history.h" #include "cc/layers/layer_impl.h" #include "cc/resources/memory_history.h" #include "cc/resources/scoped_resource.h" +#include "cc/trees/debug_rect_history.h" #include "third_party/skia/include/core/SkRefCnt.h" class SkCanvas; diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 9523b6241c1aba..70d10a380f18c1 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -16,13 +16,13 @@ #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "cc/base/simple_enclosed_region.h" -#include "cc/debug/frame_viewer_instrumentation.h" #include "cc/input/main_thread_scrolling_reason.h" #include "cc/layers/layer_client.h" #include "cc/layers/layer_impl.h" #include "cc/layers/scrollbar_layer_interface.h" #include "cc/output/copy_output_request.h" #include "cc/output/copy_output_result.h" +#include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/trees/draw_property_utils.h" #include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host.h" diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 0b6b8b44af47ab..15dc9b96ed5690 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -19,8 +19,8 @@ #include "base/observer_list.h" #include "cc/base/filter_operations.h" #include "cc/base/region.h" +#include "cc/benchmarks/micro_benchmark.h" #include "cc/cc_export.h" -#include "cc/debug/micro_benchmark.h" #include "cc/input/input_handler.h" #include "cc/layers/layer_collections.h" #include "cc/layers/layer_position_constraint.h" diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index ca7ea609be387b..6fd8b155c9a56f 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -18,9 +18,9 @@ #include "base/trace_event/trace_event_argument.h" #include "cc/base/math_util.h" #include "cc/base/simple_enclosed_region.h" +#include "cc/benchmarks/micro_benchmark_impl.h" #include "cc/debug/debug_colors.h" #include "cc/debug/layer_tree_debug_state.h" -#include "cc/debug/micro_benchmark_impl.h" #include "cc/debug/traced_value.h" #include "cc/input/main_thread_scrolling_reason.h" #include "cc/input/scroll_state.h" diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc index adb86ece63e7d4..61086a0d56ebe3 100644 --- a/cc/layers/layer_perftest.cc +++ b/cc/layers/layer_perftest.cc @@ -6,7 +6,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "cc/animation/animation_host.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h index 71209fb77a1d9e..27335e7d395d15 100644 --- a/cc/layers/picture_layer.h +++ b/cc/layers/picture_layer.h @@ -6,9 +6,9 @@ #define CC_LAYERS_PICTURE_LAYER_H_ #include "base/macros.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/base/invalidation_region.h" -#include "cc/debug/devtools_instrumentation.h" -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include "cc/layers/layer.h" namespace cc { diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 2848810ce8af8c..44b594f8a42db1 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -16,8 +16,8 @@ #include "base/time/time.h" #include "base/trace_event/trace_event_argument.h" #include "cc/base/math_util.h" +#include "cc/benchmarks/micro_benchmark_impl.h" #include "cc/debug/debug_colors.h" -#include "cc/debug/micro_benchmark_impl.h" #include "cc/debug/traced_value.h" #include "cc/layers/append_quads_data.h" #include "cc/layers/solid_color_layer_impl.h" diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index f0c113ddda5627..a434297fbc9d6f 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -6,7 +6,7 @@ #include "base/macros.h" #include "base/threading/thread_task_runner_handle.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/test/fake_compositor_frame_sink.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" diff --git a/cc/output/bsp_tree_perftest.cc b/cc/output/bsp_tree_perftest.cc index a6f2ab677c2d3f..3f365f4a78ff37 100644 --- a/cc/output/bsp_tree_perftest.cc +++ b/cc/output/bsp_tree_perftest.cc @@ -14,7 +14,7 @@ #include "base/strings/string_piece.h" #include "base/threading/thread.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/layers/layer.h" #include "cc/output/bsp_tree.h" #include "cc/quads/draw_polygon.h" diff --git a/cc/quads/draw_quad_perftest.cc b/cc/quads/draw_quad_perftest.cc index 4d648b9c6f26a8..5d6c4c2ab33a19 100644 --- a/cc/quads/draw_quad_perftest.cc +++ b/cc/quads/draw_quad_perftest.cc @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/quads/draw_quad.h" #include "cc/quads/render_pass.h" #include "cc/quads/texture_draw_quad.h" diff --git a/cc/raster/raster_buffer_provider_perftest.cc b/cc/raster/raster_buffer_provider_perftest.cc index d4dd4e4a6b4da3..6979ccadb41fe6 100644 --- a/cc/raster/raster_buffer_provider_perftest.cc +++ b/cc/raster/raster_buffer_provider_perftest.cc @@ -9,7 +9,7 @@ #include "base/memory/ptr_util.h" #include "base/test/test_simple_task_runner.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/output/context_cache_controller.h" #include "cc/output/context_provider.h" #include "cc/raster/bitmap_raster_buffer_provider.h" diff --git a/cc/raster/task_graph_runner_perftest.cc b/cc/raster/task_graph_runner_perftest.cc index a4b2af2a4790ca..62b1d629e0bef9 100644 --- a/cc/raster/task_graph_runner_perftest.cc +++ b/cc/raster/task_graph_runner_perftest.cc @@ -12,7 +12,7 @@ #include "base/memory/ptr_util.h" #include "base/time/time.h" #include "cc/base/completion_event.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/raster/synchronous_task_graph_runner.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/perf/perf_test.h" diff --git a/cc/raster/texture_compressor_perftest.cc b/cc/raster/texture_compressor_perftest.cc index 99ccb60302b997..e444c30b33f008 100644 --- a/cc/raster/texture_compressor_perftest.cc +++ b/cc/raster/texture_compressor_perftest.cc @@ -5,7 +5,7 @@ #include #include "base/logging.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/raster/texture_compressor.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/perf/perf_test.h" diff --git a/cc/resources/memory_history.h b/cc/resources/memory_history.h index 2a396485b365e3..21b27bb4bdeb3c 100644 --- a/cc/resources/memory_history.h +++ b/cc/resources/memory_history.h @@ -12,7 +12,7 @@ #include "base/macros.h" #include "base/time/time.h" -#include "cc/debug/ring_buffer.h" +#include "cc/base/ring_buffer.h" namespace cc { diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index 0e1b34e39ad9a9..4cffcd58a1674d 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -13,7 +13,7 @@ #include "base/single_thread_task_runner.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/debug/traced_value.h" #include "cc/scheduler/compositor_timing_history.h" #include "cc/scheduler/delay_based_time_source.h" diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc index 513b91a4ff7545..2b982d4694b612 100644 --- a/cc/surfaces/display.cc +++ b/cc/surfaces/display.cc @@ -10,7 +10,7 @@ #include "base/metrics/histogram_macros.h" #include "base/timer/elapsed_timer.h" #include "base/trace_event/trace_event.h" -#include "cc/debug/benchmark_instrumentation.h" +#include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/output/compositor_frame.h" #include "cc/output/direct_renderer.h" #include "cc/output/gl_renderer.h" diff --git a/cc/surfaces/surface_aggregator_perftest.cc b/cc/surfaces/surface_aggregator_perftest.cc index d86da68768c6d6..691acfd9908d21 100644 --- a/cc/surfaces/surface_aggregator_perftest.cc +++ b/cc/surfaces/surface_aggregator_perftest.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/memory/ptr_util.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/output/compositor_frame.h" #include "cc/quads/surface_draw_quad.h" #include "cc/quads/texture_draw_quad.h" diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h index 05868043d4eb64..149220617b2027 100644 --- a/cc/test/fake_layer_tree_host.h +++ b/cc/test/fake_layer_tree_host.h @@ -5,7 +5,7 @@ #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_H_ #define CC_TEST_FAKE_LAYER_TREE_HOST_H_ -#include "cc/debug/micro_benchmark_controller.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_layer_tree_host_impl.h" diff --git a/cc/debug/frame_viewer_instrumentation.cc b/cc/tiles/frame_viewer_instrumentation.cc similarity index 98% rename from cc/debug/frame_viewer_instrumentation.cc rename to cc/tiles/frame_viewer_instrumentation.cc index d34907a8746f04..e04f2018bf5498 100644 --- a/cc/debug/frame_viewer_instrumentation.cc +++ b/cc/tiles/frame_viewer_instrumentation.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/frame_viewer_instrumentation.h" +#include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/debug/traced_value.h" diff --git a/cc/debug/frame_viewer_instrumentation.h b/cc/tiles/frame_viewer_instrumentation.h similarity index 85% rename from cc/debug/frame_viewer_instrumentation.h rename to cc/tiles/frame_viewer_instrumentation.h index 119e523df232aa..d4cef013021c7c 100644 --- a/cc/debug/frame_viewer_instrumentation.h +++ b/cc/tiles/frame_viewer_instrumentation.h @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_FRAME_VIEWER_INSTRUMENTATION_H_ -#define CC_DEBUG_FRAME_VIEWER_INSTRUMENTATION_H_ +#ifndef CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_ +#define CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_ #include "base/macros.h" #include "base/trace_event/trace_event.h" -#include "cc/tiles/tile.h" #include "cc/tiles/tile_priority.h" namespace cc { @@ -44,4 +43,4 @@ bool IsTracingLayerTreeSnapshots(); } // namespace frame_viewer_instrumentation } // namespace cc -#endif // CC_DEBUG_FRAME_VIEWER_INSTRUMENTATION_H_ +#endif // CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_ diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 735afc7f6cbc42..3ea22ba20faaea 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc @@ -16,7 +16,7 @@ #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/output/context_provider.h" #include "cc/raster/tile_task.h" #include "cc/resources/resource_format_utils.h" diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc index e5d3319ceb483c..a113be9dd198ca 100644 --- a/cc/tiles/software_image_decode_cache.cc +++ b/cc/tiles/software_image_decode_cache.cc @@ -19,7 +19,7 @@ #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/raster/tile_task.h" #include "cc/resources/resource_format_utils.h" #include "cc/tiles/mipmap_util.h" diff --git a/cc/tiles/software_image_decode_cache_perftest.cc b/cc/tiles/software_image_decode_cache_perftest.cc index f13e1cfac6d258..5d5b4285392c52 100644 --- a/cc/tiles/software_image_decode_cache_perftest.cc +++ b/cc/tiles/software_image_decode_cache_perftest.cc @@ -4,7 +4,7 @@ #include -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/paint/draw_image.h" #include "cc/raster/tile_task.h" #include "cc/tiles/software_image_decode_cache.h" diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index 76d0a2ac9b8254..9916918d96ce14 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc @@ -21,13 +21,13 @@ #include "base/optional.h" #include "base/threading/thread_checker.h" #include "base/trace_event/trace_event_argument.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" -#include "cc/debug/devtools_instrumentation.h" -#include "cc/debug/frame_viewer_instrumentation.h" #include "cc/debug/traced_value.h" #include "cc/layers/picture_layer_impl.h" #include "cc/raster/raster_buffer.h" #include "cc/raster/task_category.h" +#include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/tiles/tile.h" #include "ui/gfx/geometry/rect_conversions.h" diff --git a/cc/tiles/tile_manager_perftest.cc b/cc/tiles/tile_manager_perftest.cc index 93b4dee0d0e79d..c87e217a5d85b6 100644 --- a/cc/tiles/tile_manager_perftest.cc +++ b/cc/tiles/tile_manager_perftest.cc @@ -10,7 +10,7 @@ #include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/raster/raster_buffer.h" #include "cc/test/begin_frame_args_test.h" #include "cc/test/fake_compositor_frame_sink.h" diff --git a/cc/debug/debug_rect_history.cc b/cc/trees/debug_rect_history.cc similarity index 91% rename from cc/debug/debug_rect_history.cc rename to cc/trees/debug_rect_history.cc index 33a9a35340ae00..40afdc85792e9b 100644 --- a/cc/debug/debug_rect_history.cc +++ b/cc/trees/debug_rect_history.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/debug_rect_history.h" +#include "cc/trees/debug_rect_history.h" #include @@ -96,8 +96,7 @@ void DebugRectHistory::SavePropertyChangedRects( DCHECK(render_surface); const LayerImplList& layer_list = render_surface->layer_list(); - for (unsigned layer_index = 0; - layer_index < layer_list.size(); + for (unsigned layer_index = 0; layer_index < layer_list.size(); ++layer_index) { LayerImpl* layer = layer_list[layer_index]; @@ -144,11 +143,10 @@ void DebugRectHistory::SaveScreenSpaceRects( render_surface_layer->GetRenderSurface(); DCHECK(render_surface); - debug_rects_.push_back( - DebugRect(SCREEN_SPACE_RECT_TYPE, - MathUtil::MapEnclosingClippedRect( - render_surface->screen_space_transform(), - render_surface->content_rect()))); + debug_rects_.push_back(DebugRect( + SCREEN_SPACE_RECT_TYPE, MathUtil::MapEnclosingClippedRect( + render_surface->screen_space_transform(), + render_surface->content_rect()))); } } @@ -160,8 +158,7 @@ void DebugRectHistory::SaveTouchEventHandlerRects(LayerTreeImpl* tree_impl) { void DebugRectHistory::SaveTouchEventHandlerRectsCallback(LayerImpl* layer) { for (Region::Iterator iter(layer->touch_event_handler_region()); - iter.has_rect(); - iter.next()) { + iter.has_rect(); iter.next()) { debug_rects_.push_back( DebugRect(TOUCH_EVENT_HANDLER_RECT_TYPE, MathUtil::MapEnclosingClippedRect( @@ -212,8 +209,7 @@ void DebugRectHistory::SaveNonFastScrollableRects(LayerTreeImpl* tree_impl) { void DebugRectHistory::SaveNonFastScrollableRectsCallback(LayerImpl* layer) { for (Region::Iterator iter(layer->non_fast_scrollable_region()); - iter.has_rect(); - iter.next()) { + iter.has_rect(); iter.next()) { debug_rects_.push_back( DebugRect(NON_FAST_SCROLLABLE_RECT_TYPE, MathUtil::MapEnclosingClippedRect( @@ -237,10 +233,9 @@ void DebugRectHistory::SaveLayerAnimationBoundsRects( debug_rects_.push_back( DebugRect(ANIMATION_BOUNDS_RECT_TYPE, - gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), - inflated_bounds.y(), - inflated_bounds.width(), - inflated_bounds.height())))); + gfx::ToEnclosingRect(gfx::RectF( + inflated_bounds.x(), inflated_bounds.y(), + inflated_bounds.width(), inflated_bounds.height())))); } } diff --git a/cc/debug/debug_rect_history.h b/cc/trees/debug_rect_history.h similarity index 91% rename from cc/debug/debug_rect_history.h rename to cc/trees/debug_rect_history.h index 514a72bfd33547..008cf6045ec2d8 100644 --- a/cc/debug/debug_rect_history.h +++ b/cc/trees/debug_rect_history.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_DEBUG_RECT_HISTORY_H_ -#define CC_DEBUG_DEBUG_RECT_HISTORY_H_ +#ifndef CC_TREES_DEBUG_RECT_HISTORY_H_ +#define CC_TREES_DEBUG_RECT_HISTORY_H_ #include #include @@ -78,10 +78,8 @@ class DebugRectHistory { void SavePaintRects(LayerTreeImpl* tree_impl); void SavePropertyChangedRects(const LayerImplList& render_surface_layer_list, LayerImpl* hud_layer); - void SaveSurfaceDamageRects( - const LayerImplList& render_surface_layer_list); - void SaveScreenSpaceRects( - const LayerImplList& render_surface_layer_list); + void SaveSurfaceDamageRects(const LayerImplList& render_surface_layer_list); + void SaveScreenSpaceRects(const LayerImplList& render_surface_layer_list); void SaveTouchEventHandlerRects(LayerTreeImpl* layer); void SaveTouchEventHandlerRectsCallback(LayerImpl* layer); void SaveWheelEventHandlerRects(LayerTreeImpl* tree_impl); @@ -99,4 +97,4 @@ class DebugRectHistory { } // namespace cc -#endif // CC_DEBUG_DEBUG_RECT_HISTORY_H_ +#endif // CC_TREES_DEBUG_RECT_HISTORY_H_ diff --git a/cc/debug/frame_rate_counter.cc b/cc/trees/frame_rate_counter.cc similarity index 93% rename from cc/debug/frame_rate_counter.cc rename to cc/trees/frame_rate_counter.cc index c523f6d8e9943b..f801dbf640d97c 100644 --- a/cc/debug/frame_rate_counter.cc +++ b/cc/trees/frame_rate_counter.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/debug/frame_rate_counter.h" +#include "cc/trees/frame_rate_counter.h" #include @@ -11,7 +11,6 @@ #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" -#include "cc/trees/proxy.h" namespace cc { @@ -62,16 +61,11 @@ void FrameRateCounter::SaveTimeStamp(base::TimeTicks timestamp, bool software) { if (software) { UMA_HISTOGRAM_CUSTOM_COUNTS( "Renderer4.SoftwareCompositorThreadImplDrawDelay", - frame_interval_seconds.InMilliseconds(), - 1, - 120, - 60); + frame_interval_seconds.InMilliseconds(), 1, 120, 60); } else { UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", - frame_interval_seconds.InMilliseconds(), - 1, - 120, - 60); + frame_interval_seconds.InMilliseconds(), 1, + 120, 60); } } @@ -129,8 +123,7 @@ double FrameRateCounter::GetAverageFPS() const { // IsBadFrameInterval encapsulates the frame too slow/frame too fast logic. for (RingBufferType::Iterator it = --ring_buffer_.End(); - it && frame_times_total < 1.0; - --it) { + it && frame_times_total < 1.0; --it) { base::TimeDelta delta = RecentFrameInterval(it.index() + 1); if (!IsBadFrameInterval(delta)) { diff --git a/cc/debug/frame_rate_counter.h b/cc/trees/frame_rate_counter.h similarity index 92% rename from cc/debug/frame_rate_counter.h rename to cc/trees/frame_rate_counter.h index ba2d122cf1dc97..83e8cf7151ffea 100644 --- a/cc/debug/frame_rate_counter.h +++ b/cc/trees/frame_rate_counter.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_DEBUG_FRAME_RATE_COUNTER_H_ -#define CC_DEBUG_FRAME_RATE_COUNTER_H_ +#ifndef CC_TREES_FRAME_RATE_COUNTER_H_ +#define CC_TREES_FRAME_RATE_COUNTER_H_ #include @@ -11,7 +11,7 @@ #include "base/macros.h" #include "base/time/time.h" -#include "cc/debug/ring_buffer.h" +#include "cc/base/ring_buffer.h" namespace cc { @@ -57,4 +57,4 @@ class FrameRateCounter { } // namespace cc -#endif // CC_DEBUG_FRAME_RATE_COUNTER_H_ +#endif // CC_TREES_FRAME_RATE_COUNTER_H_ diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 98a271475ad488..eeaf289a51b114 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -29,10 +29,9 @@ #include "base/timer/elapsed_timer.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" #include "cc/base/math_util.h" -#include "cc/debug/devtools_instrumentation.h" -#include "cc/debug/frame_viewer_instrumentation.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/input/layer_selection_bound.h" #include "cc/input/page_scale_animation.h" @@ -42,6 +41,7 @@ #include "cc/layers/layer_iterator.h" #include "cc/layers/painted_scrollbar_layer.h" #include "cc/resources/ui_resource_manager.h" +#include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/trees/draw_property_utils.h" #include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host_client.h" diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index a78a89c2c448d4..afa029f2a11a46 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -20,9 +20,9 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" +#include "cc/benchmarks/micro_benchmark.h" +#include "cc/benchmarks/micro_benchmark_controller.h" #include "cc/cc_export.h" -#include "cc/debug/micro_benchmark.h" -#include "cc/debug/micro_benchmark_controller.h" #include "cc/input/browser_controls_state.h" #include "cc/input/event_listener_properties.h" #include "cc/input/input_handler.h" diff --git a/cc/trees/layer_tree_host_common_perftest.cc b/cc/trees/layer_tree_host_common_perftest.cc index 132872c5a671aa..4a2724fd15d39f 100644 --- a/cc/trees/layer_tree_host_common_perftest.cc +++ b/cc/trees/layer_tree_host_common_perftest.cc @@ -14,7 +14,7 @@ #include "base/strings/string_piece.h" #include "base/threading/thread.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/layers/layer.h" #include "cc/test/fake_content_layer_client.h" #include "cc/test/fake_layer_tree_host_client.h" diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index c7238e8b010676..d9f1a22aefd1c6 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -24,13 +24,10 @@ #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event_argument.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" #include "cc/base/math_util.h" -#include "cc/debug/benchmark_instrumentation.h" -#include "cc/debug/debug_rect_history.h" -#include "cc/debug/devtools_instrumentation.h" -#include "cc/debug/frame_rate_counter.h" -#include "cc/debug/frame_viewer_instrumentation.h" +#include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/debug/traced_value.h" #include "cc/input/browser_controls_offset_manager.h" @@ -67,12 +64,15 @@ #include "cc/resources/ui_resource_bitmap.h" #include "cc/scheduler/delay_based_time_source.h" #include "cc/tiles/eviction_tile_priority_queue.h" +#include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/tiles/gpu_image_decode_cache.h" #include "cc/tiles/picture_layer_tiling.h" #include "cc/tiles/raster_tile_priority_queue.h" #include "cc/tiles/software_image_decode_cache.h" #include "cc/trees/damage_tracker.h" +#include "cc/trees/debug_rect_history.h" #include "cc/trees/draw_property_utils.h" +#include "cc/trees/frame_rate_counter.h" #include "cc/trees/latency_info_swap_promise_monitor.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index b69457cfba55c6..f02a36c93d9f84 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -18,8 +18,8 @@ #include "base/macros.h" #include "base/time/time.h" #include "cc/base/synced_property.h" +#include "cc/benchmarks/micro_benchmark_controller_impl.h" #include "cc/cc_export.h" -#include "cc/debug/micro_benchmark_controller_impl.h" #include "cc/input/browser_controls_offset_manager_client.h" #include "cc/input/input_handler.h" #include "cc/input/scrollbar_animation_controller.h" diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc index 1a25a13cb116eb..863b69dd9487a4 100644 --- a/cc/trees/layer_tree_host_perftest.cc +++ b/cc/trees/layer_tree_host_perftest.cc @@ -13,7 +13,7 @@ #include "base/path_service.h" #include "base/strings/string_piece.h" #include "base/time/time.h" -#include "cc/debug/lap_timer.h" +#include "cc/base/lap_timer.h" #include "cc/layers/nine_patch_layer.h" #include "cc/layers/solid_color_layer.h" #include "cc/layers/texture_layer.h" diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index a48fb96c673340..5733c1c7e1efb5 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -17,7 +17,6 @@ #include "base/synchronization/lock.h" #include "base/threading/thread_task_runner_handle.h" #include "cc/animation/timing_function.h" -#include "cc/debug/frame_rate_counter.h" #include "cc/input/scroll_elasticity_helper.h" #include "cc/layers/content_layer_client.h" #include "cc/layers/layer_impl.h" @@ -55,6 +54,7 @@ #include "cc/test/test_web_graphics_context_3d.h" #include "cc/trees/clip_node.h" #include "cc/trees/effect_node.h" +#include "cc/trees/frame_rate_counter.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_host_impl.h" #include "cc/trees/layer_tree_impl.h" diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 36bebc3be83af2..de3719c4a1d239 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -17,10 +17,10 @@ #include "base/timer/elapsed_timer.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" +#include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" #include "cc/base/math_util.h" #include "cc/base/synced_property.h" -#include "cc/debug/devtools_instrumentation.h" #include "cc/debug/traced_value.h" #include "cc/input/page_scale_animation.h" #include "cc/input/scrollbar_animation_controller.h" diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 2dfa6abdc64524..3817b28fa3cfc6 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc @@ -12,8 +12,8 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" #include "base/trace_event/trace_event_synthetic_delay.h" -#include "cc/debug/benchmark_instrumentation.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" +#include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/input/browser_controls_offset_manager.h" #include "cc/output/compositor_frame_sink.h" #include "cc/output/context_provider.h" diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index 968ea1ba893171..5b9e7f0e576ca5 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc @@ -12,8 +12,8 @@ #include "base/trace_event/trace_event_argument.h" #include "base/trace_event/trace_event_synthetic_delay.h" #include "cc/base/completion_event.h" -#include "cc/debug/benchmark_instrumentation.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" +#include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/output/compositor_frame_sink.h" #include "cc/output/swap_promise.h" #include "cc/resources/ui_resource_manager.h" diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 48ab24e8c09085..eeae9b6caf8a23 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -8,8 +8,8 @@ #include "base/memory/ptr_util.h" #include "base/profiler/scoped_tracker.h" #include "base/trace_event/trace_event.h" -#include "cc/debug/benchmark_instrumentation.h" -#include "cc/debug/devtools_instrumentation.h" +#include "cc/base/devtools_instrumentation.h" +#include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/output/compositor_frame_sink.h" #include "cc/output/context_provider.h" #include "cc/quads/draw_quad.h" diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index ff45901e5eb4ad..2fcff06f862c5d 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -31,9 +31,9 @@ #include "cc/animation/animation_timeline.h" #include "cc/base/region.h" #include "cc/base/switches.h" +#include "cc/benchmarks/micro_benchmark.h" #include "cc/blink/web_layer_impl.h" #include "cc/debug/layer_tree_debug_state.h" -#include "cc/debug/micro_benchmark.h" #include "cc/input/layer_selection_bound.h" #include "cc/layers/layer.h" #include "cc/output/begin_frame_args.h"