| Index: cc/benchmarks/rasterize_and_record_benchmark.cc
|
| diff --git a/cc/benchmarks/rasterize_and_record_benchmark.cc b/cc/benchmarks/rasterize_and_record_benchmark.cc
|
| index 6314fdef87ea4538b62ecf1123793a0b0b592fbd..b14bd5827bf090771522cfb743ba24b8ac1c6f4d 100644
|
| --- a/cc/benchmarks/rasterize_and_record_benchmark.cc
|
| +++ b/cc/benchmarks/rasterize_and_record_benchmark.cc
|
| @@ -25,6 +25,12 @@
|
| #include "skia/ext/analysis_canvas.h"
|
| #include "ui/gfx/geometry/rect.h"
|
|
|
| +namespace blink {
|
| +int* paintCounts();
|
| +int* rareDataReasonCounts();
|
| +int* frameCounts();
|
| +}
|
| +
|
| namespace cc {
|
|
|
| namespace {
|
| @@ -89,6 +95,85 @@ RasterizeAndRecordBenchmark::~RasterizeAndRecordBenchmark() {
|
| weak_ptr_factory_.InvalidateWeakPtrs();
|
| }
|
|
|
| +static const int kMaxReason = 58;
|
| +
|
| +static const char* reasonNames[kMaxReason] = {
|
| + "lo_all",
|
| + "lo_inFlowSelfPaintingLayer",
|
| + "lo_inFlowSelfPaintingLayerDiffPC",
|
| + "lo_previousLocation",
|
| + "lo_floatLayerBug1",
|
| + "lo_floatLayerBug2",
|
| + "lo_svgForeignBug",
|
| + "li_all",
|
| + "li_createsLineBoxes",
|
| + "lt_all",
|
| + "lt_canUseParentVisualRect",
|
| + "lt_zeroOrOneLineBox",
|
| + "lt_zeroOrOneLineBoxCanUse",
|
| + "lb_all",
|
| + "lb_rareData",
|
| + "lb_inlineBoxWrapper",
|
| + "lb_spannerPlaceholder",
|
| + "lb_overrideSize",
|
| + "lb_pageOffset",
|
| + "lb_paginationStrut",
|
| + "lb_previousSize",
|
| + "lb_previousLayoutOverflow",
|
| + "lb_previousContentBox",
|
| + "lb_previousContentBoxSizeIfDiff",
|
| + "lb_positionedContainer",
|
| + "lb_positionedDiffPC",
|
| + "lb_percentHeightContainer",
|
| + "lb_contentBoxDiff",
|
| + "lb_layoutOverflowDiff",
|
| + "lbl_all",
|
| + "lbl_positionedDescendants",
|
| + "lbl_percentHeightDescendants",
|
| + "lbf_all",
|
| + "lbf_rareData",
|
| + "lbf_paginationStrutFromChild",
|
| + "lbf_lineBreakToAvoidWidow",
|
| + "lbf_discardMargin",
|
| + "lbf_margin",
|
| + "lbf_multiColumnFlowThread",
|
| + "lts_all",
|
| + "lts_composited",
|
| + "lts_nonComposited",
|
| + "lts_compositedWithContainerBackground",
|
| + "ltr_all",
|
| + "ltr_composited",
|
| + "ltr_nonComposited",
|
| + "ltr_compositedWithContainerBackground",
|
| + "ltc_all",
|
| + "ltc_invisibleCollapsedBorders",
|
| + "ltc_collapsedBorders",
|
| + "ltc_composited",
|
| + "ltc_nonComposited",
|
| + "ltc_compositedWithContainerBackground",
|
| + "lo_object",
|
| + "lo_box",
|
| + "lo_text",
|
| + "lo_inline",
|
| + "lo_svg",
|
| +};
|
| +
|
| +static const char* paintNames[] = {
|
| + "p_empty_background", "p_empty_float", "p_empty_foreground",
|
| + "p_empty_outline", "p_empty_all", "p_all",
|
| + "p_no_background", "p_no_float", "p_no_outline",
|
| +};
|
| +
|
| +static const char* frameNames[] = {
|
| + "frame_all",
|
| + "frame_remote",
|
| + "frame_noOwnerLayoutObject",
|
| + "frame_throttled",
|
| + "frame_throttledNoOwnerLayoutObject",
|
| + "frame_noLayoutView",
|
| + "frame_noView",
|
| +};
|
| +
|
| void RasterizeAndRecordBenchmark::DidUpdateLayers(
|
| LayerTreeHost* layer_tree_host) {
|
| layer_tree_host_ = layer_tree_host;
|
| @@ -101,6 +186,22 @@ void RasterizeAndRecordBenchmark::DidUpdateLayers(
|
| results_->SetInteger("pixels_recorded", record_results_.pixels_recorded);
|
| results_->SetInteger("picture_memory_usage",
|
| static_cast<int>(record_results_.bytes_used));
|
| + int* reason_counts = blink::rareDataReasonCounts();
|
| + for (int i = 0; i < kMaxReason; ++i) {
|
| + results_->SetInteger(reasonNames[i], reason_counts[i]);
|
| + reason_counts[i] = 0;
|
| + }
|
| +
|
| + int* paint_counts = blink::paintCounts();
|
| + for (int i = 0; i < 9; ++i) {
|
| + results_->SetInteger(paintNames[i], paint_counts[i]);
|
| + paint_counts[i] = 0;
|
| + }
|
| +
|
| + int* frame_counts = blink::frameCounts();
|
| + for (int i = 0; i < 7; ++i) {
|
| + results_->SetInteger(frameNames[i], frame_counts[i]);
|
| + }
|
|
|
| for (int i = 0; i < RecordingSource::RECORDING_MODE_COUNT; i++) {
|
| std::string name = base::StringPrintf("record_time%s_ms", kModeSuffixes[i]);
|
|
|