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}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 67ed133..4d4b7db 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -7,38 +7,26 @@
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 @@
"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 @@
"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 @@
"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 776a687..4da56d0 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 e155d84..db70d19 100644
--- a/cc/base/BUILD.gn
+++ b/cc/base/BUILD.gn
@@ -14,6 +14,8 @@
"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 @@
"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 e5743405..010b161 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/base/devtools_instrumentation.h b/cc/base/devtools_instrumentation.h
new file mode 100644
index 0000000..40e2d9e
--- /dev/null
+++ b/cc/base/devtools_instrumentation.h
@@ -0,0 +1,191 @@
+// Copyright 2013 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.
+
+#ifndef CC_BASE_DEVTOOLS_INSTRUMENTATION_H_
+#define CC_BASE_DEVTOOLS_INSTRUMENTATION_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "base/macros.h"
+#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 {
+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[];
+CC_BASE_EXPORT extern const char kUpdateLayer[];
+
+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_); }
+
+ private:
+ const char* event_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask);
+};
+
+class CC_BASE_EXPORT ScopedImageDecodeTask {
+ public:
+ enum Type { SOFTWARE, GPU };
+
+ ScopedImageDecodeTask(const void* imagePtr, Type type)
+ : type_(type), start_time_(base::TimeTicks::Now()) {
+ TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask,
+ internal::kPixelRefId,
+ reinterpret_cast<uint64_t>(imagePtr));
+ }
+ ~ScopedImageDecodeTask() {
+ TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask);
+ base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
+ switch (type_) {
+ case SOFTWARE:
+ UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Software",
+ duration.InMicroseconds());
+ break;
+ case GPU:
+ UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu",
+ duration.InMicroseconds());
+ break;
+ }
+ }
+
+ private:
+ const Type type_;
+ const base::TimeTicks start_time_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask);
+};
+
+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_); }
+
+ private:
+ const char* event_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedLayerTreeTask);
+};
+
+struct CC_BASE_EXPORT ScopedCommitTrace {
+ public:
+ explicit ScopedCommitTrace(int layer_tree_host_id) {
+ TRACE_EVENT_BEGIN1(internal::kCategory, internal::kCompositeLayers,
+ internal::kLayerTreeId, layer_tree_host_id);
+ }
+ ~ScopedCommitTrace() {
+ TRACE_EVENT_END0(internal::kCategory, internal::kCompositeLayers);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedCommitTrace);
+};
+
+struct CC_BASE_EXPORT ScopedLayerObjectTracker
+ : public base::trace_event::TraceScopedTrackableObject<int> {
+ explicit ScopedLayerObjectTracker(int layer_id)
+ : base::trace_event::TraceScopedTrackableObject<int>(internal::kCategory,
+ internal::kLayerId,
+ layer_id) {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker);
+};
+
+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 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 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 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<base::trace_event::ConvertableToTraceFormat>
+BeginMainThreadFrameData(int frame_id) {
+ std::unique_ptr<base::trace_event::TracedValue> value(
+ new base::trace_event::TracedValue());
+ value->SetInteger("frameId", frame_id);
+ return std::move(value);
+}
+
+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,
+ internal::kData, BeginMainThreadFrameData(frame_id));
+}
+
+inline std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
+NeedsBeginFrameData(bool needs_begin_frame) {
+ std::unique_ptr<base::trace_event::TracedValue> value(
+ new base::trace_event::TracedValue());
+ value->SetInteger("needsBeginFrame", needs_begin_frame);
+ return std::move(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,
+ internal::kData, NeedsBeginFrameData(new_value));
+}
+
+} // namespace devtools_instrumentation
+} // namespace cc
+
+#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 2c5d381..6702311 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 @@
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 @@
}
}
-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 @@
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 bdba8ac..5b27e25 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 @@
// 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 @@
} // 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 5f7d49a..e4b03cb 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 <stddef.h>
@@ -12,23 +12,17 @@
namespace cc {
-template<typename T, size_t kSize>
+template <typename T, size_t kSize>
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 @@
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 @@
private:
Iterator(const RingBuffer<T, kSize>& buffer, size_t index)
- : buffer_(buffer),
- index_(index),
- out_of_range_(false) {
- }
+ : buffer_(buffer), index_(index), out_of_range_(false) {}
const RingBuffer<T, kSize>& buffer_;
size_t index_;
@@ -103,9 +92,7 @@
// Returns an Iterator pointing to the newest value in the buffer.
// Example usage (iterate backwards from newest to oldest value):
// for (RingBuffer<T, kSize>::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 @@
} // 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 85aee07..d18d0f6 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 ff221715..5674c2f 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 6e8ac6b..9b5e5ef 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 @@
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 @@
} // 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 6e6d3433..89f5973f 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 <stdint.h>
@@ -60,8 +60,7 @@
}
}
-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 84%
rename from cc/debug/invalidation_benchmark.h
rename to cc/benchmarks/invalidation_benchmark.h
index a04663d6..b9fbb72 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 <stdint.h>
#include <string>
-#include "cc/debug/micro_benchmark_controller.h"
+#include "cc/benchmarks/micro_benchmark_controller.h"
namespace cc {
@@ -43,4 +43,4 @@
} // 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 4bbca39..456431b 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 <memory>
@@ -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 @@
: 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 80302b7..5ffadc0 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 <memory>
@@ -57,4 +57,4 @@
} // 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 3a72194..f55a607 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 <limits>
#include <string>
@@ -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 88ccc84..0f38800 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 <string>
#include <vector>
#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 @@
} // 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 94%
rename from cc/debug/micro_benchmark_controller_impl.cc
rename to cc/benchmarks/micro_benchmark_controller_impl.cc
index e02b76d..2e53c45 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 <string>
diff --git a/cc/debug/micro_benchmark_controller_impl.h b/cc/benchmarks/micro_benchmark_controller_impl.h
similarity index 76%
rename from cc/debug/micro_benchmark_controller_impl.h
rename to cc/benchmarks/micro_benchmark_controller_impl.h
index 67c8005..7948243 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 <string>
#include <vector>
#include "base/macros.h"
-#include "cc/debug/micro_benchmark_impl.h"
+#include "cc/benchmarks/micro_benchmark_impl.h"
namespace cc {
@@ -34,4 +34,4 @@
} // 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 4a6ce7e5..08f3de6e 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 <memory>
@@ -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 @@
}
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, 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, 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 @@
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 @@
// 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 8f818fd1..d660645 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 <memory>
@@ -20,7 +20,6 @@
std::unique_ptr<base::Value> result) {
callback.Run(std::move(result));
}
-
}
MicroBenchmarkImpl::MicroBenchmarkImpl(
@@ -28,8 +27,7 @@
scoped_refptr<base::SingleThreadTaskRunner> 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 dbbecd8..d13ba4f 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 <memory>
@@ -46,4 +46,4 @@
} // 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 96%
rename from cc/debug/rasterize_and_record_benchmark.cc
rename to cc/benchmarks/rasterize_and_record_benchmark.cc
index 0e13b01..6314fdef 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 <stddef.h>
@@ -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 @@
}
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 87%
rename from cc/debug/rasterize_and_record_benchmark.h
rename to cc/benchmarks/rasterize_and_record_benchmark.h
index d4ba6a6..14871642 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 <stddef.h>
@@ -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 @@
} // 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 97%
rename from cc/debug/rasterize_and_record_benchmark_impl.cc
rename to cc/benchmarks/rasterize_and_record_benchmark_impl.cc
index 1a1dfb6..0144636 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 <stddef.h>
@@ -10,7 +10,7 @@
#include <limits>
#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 @@
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 6d25c8a..2804c014 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 <stddef.h>
@@ -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 @@
} // 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 321444d..5ba8bcfe 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 ffeaceb..277c4274 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 @@
} // 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 59e3d27..7bad5474 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 @@
scoped_refptr<base::SingleThreadTaskRunner> 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 75%
rename from cc/debug/unittest_only_benchmark_impl.h
rename to cc/benchmarks/unittest_only_benchmark_impl.h
index 1444850..a378b9e 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 @@
} // namespace cc
-#endif // CC_DEBUG_UNITTEST_ONLY_BENCHMARK_IMPL_H_
+#endif // CC_BENCHMARKS_UNITTEST_ONLY_BENCHMARK_IMPL_H_
diff --git a/cc/debug/devtools_instrumentation.h b/cc/debug/devtools_instrumentation.h
deleted file mode 100644
index 3aa1863..0000000
--- a/cc/debug/devtools_instrumentation.h
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
-#define CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
-
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/macros.h"
-#include "base/metrics/histogram_macros.h"
-#include "base/trace_event/trace_event.h"
-#include "base/trace_event/trace_event_argument.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[];
-} // namespace internal
-
-extern const char kPaintSetup[];
-extern const char kUpdateLayer[];
-
-class 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_);
- }
- private:
- const char* event_name_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask);
-};
-
-class ScopedImageDecodeTask {
- public:
- enum Type { SOFTWARE, GPU };
-
- ScopedImageDecodeTask(const void* imagePtr, Type type)
- : type_(type), start_time_(base::TimeTicks::Now()) {
- TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask,
- internal::kPixelRefId,
- reinterpret_cast<uint64_t>(imagePtr));
- }
- ~ScopedImageDecodeTask() {
- TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask);
- base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
- switch (type_) {
- case SOFTWARE:
- UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Software",
- duration.InMicroseconds());
- break;
- case GPU:
- UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu",
- duration.InMicroseconds());
- break;
- }
- }
-
- private:
- const Type type_;
- const base::TimeTicks start_time_;
- DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask);
-};
-
-class 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_);
- }
- private:
- const char* event_name_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedLayerTreeTask);
-};
-
-struct ScopedCommitTrace {
- public:
- explicit ScopedCommitTrace(int layer_tree_host_id) {
- TRACE_EVENT_BEGIN1(internal::kCategory, internal::kCompositeLayers,
- internal::kLayerTreeId, layer_tree_host_id);
- }
- ~ScopedCommitTrace() {
- TRACE_EVENT_END0(internal::kCategory, internal::kCompositeLayers);
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedCommitTrace);
-};
-
-struct ScopedLayerObjectTracker
- : public base::trace_event::TraceScopedTrackableObject<int> {
- explicit ScopedLayerObjectTracker(int layer_id)
- : base::trace_event::TraceScopedTrackableObject<int>(
- 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 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,
- 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 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
-BeginMainThreadFrameData(int frame_id) {
- std::unique_ptr<base::trace_event::TracedValue> value(
- new base::trace_event::TracedValue());
- value->SetInteger("frameId", frame_id);
- return std::move(value);
-}
-
-inline void 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,
- internal::kData, BeginMainThreadFrameData(frame_id));
-}
-
-inline std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
-NeedsBeginFrameData(bool needs_begin_frame) {
- std::unique_ptr<base::trace_event::TracedValue> value(
- new base::trace_event::TracedValue());
- value->SetInteger("needsBeginFrame", needs_begin_frame);
- return std::move(value);
-}
-
-inline void 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,
- internal::kData, NeedsBeginFrameData(new_value));
-}
-
-} // namespace devtools_instrumentation
-} // namespace cc
-
-#endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 050dcda..7340f18 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 c7f0577..b808ebc 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 9523b62..70d10a3 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 0b6b8b4..15dc9b96 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 ca7ea609..6fd8b15 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 adb86ece..61086a0 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 71209fb..27335e7 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 2848810..44b594f8 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 f0c113d..a434297 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 a6f2ab67..3f365f4 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 4d648b9..5d6c4c2 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 d4dd4e4a..6979cca 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 a4b2af2a..62b1d62 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 99ccb60..e444c30 100644
--- a/cc/raster/texture_compressor_perftest.cc
+++ b/cc/raster/texture_compressor_perftest.cc
@@ -5,7 +5,7 @@
#include <stdint.h>
#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 2a39648..21b27bb 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 0e1b34e..4cffcd5 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 513b91a..2b982d4 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 d86da68..691acfd9 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 0586804..1492206 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 97%
rename from cc/debug/frame_viewer_instrumentation.cc
rename to cc/tiles/frame_viewer_instrumentation.cc
index d34907a..e04f201 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 119e523..d4cef01 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 @@
} // 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 735afc7f..3ea22ba 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 e5d3319c..a113be9 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 f13e1cf..5d5b4285 100644
--- a/cc/tiles/software_image_decode_cache_perftest.cc
+++ b/cc/tiles/software_image_decode_cache_perftest.cc
@@ -4,7 +4,7 @@
#include <vector>
-#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 76d0a2a..9916918 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 93b4dee..c87e217 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 33a9a35..40afdc85 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 <stddef.h>
@@ -96,8 +96,7 @@
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 @@
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::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::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 @@
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 514a72b..008cf60 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 <memory>
#include <vector>
@@ -78,10 +78,8 @@
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 @@
} // 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 92%
rename from cc/debug/frame_rate_counter.cc
rename to cc/trees/frame_rate_counter.cc
index c523f6d..f801dbf6 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 <stddef.h>
@@ -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 @@
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 @@
// 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 91%
rename from cc/debug/frame_rate_counter.h
rename to cc/trees/frame_rate_counter.h
index ba2d122..83e8cf71 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 <stddef.h>
@@ -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 @@
} // 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 98a2714..eeaf289a 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 a78a89c..afa029f 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 132872c..4a2724f 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 c7238e8..d9f1a22 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 b69457cf..f02a36c 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 1a25a13..863b69d 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 a48fb96..5733c1c7 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 36bebc3..de3719c4 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 2dfa6ab..3817b28 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 968ea1b..5b9e7f0e 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 48ab24e..eeae9b6c 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 ff45901..2fcff06 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"