summaryrefslogtreecommitdiffstats
path: root/cc/debug/rasterize_and_record_benchmark.cc
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2015-08-12 11:33:39 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-12 18:34:36 +0000
commitdf636a10c5cb2687f7b12cfbf7d5186bc21bdfd6 (patch)
tree56059b707a5a8c57efc2cdf4ef52f67deff6e23a /cc/debug/rasterize_and_record_benchmark.cc
parent9febb059904b30661543102a540cf8ae00a78cae (diff)
downloadchromium_src-df636a10c5cb2687f7b12cfbf7d5186bc21bdfd6.zip
chromium_src-df636a10c5cb2687f7b12cfbf7d5186bc21bdfd6.tar.gz
chromium_src-df636a10c5cb2687f7b12cfbf7d5186bc21bdfd6.tar.bz2
cc: Add solid color analysis to rasterize_and_record's record_time
This adds record-time solid color analysis (that is, solid color analysis that's performed on a per-layer basis) to the record_time metrics computed by rasterize_and_record. Note to Perf sheriffs: this is expected to increase record_time by ~0.7%. BUG=518845 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1289583002 Cr-Commit-Position: refs/heads/master@{#343062}
Diffstat (limited to 'cc/debug/rasterize_and_record_benchmark.cc')
-rw-r--r--cc/debug/rasterize_and_record_benchmark.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/debug/rasterize_and_record_benchmark.cc
index a7ee99d..b253436 100644
--- a/cc/debug/rasterize_and_record_benchmark.cc
+++ b/cc/debug/rasterize_and_record_benchmark.cc
@@ -20,6 +20,7 @@
#include "cc/playback/picture_pile.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_common.h"
+#include "skia/ext/analysis_canvas.h"
#include "third_party/skia/include/utils/SkPictureUtils.h"
#include "ui/gfx/geometry/rect.h"
@@ -151,6 +152,11 @@ void RasterizeAndRecordBenchmark::RunOnPictureLayer(
do {
picture = Picture::Create(visible_layer_rect, painter, tile_grid_size,
false, mode);
+ if (picture->ShouldBeAnalyzedForSolidColor()) {
+ gfx::Size layer_size = layer->paint_properties().bounds;
+ skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height());
+ picture->Raster(&canvas, nullptr, gfx::Rect(), 1.f);
+ }
if (memory_used) {
// Verify we are recording the same thing each time.
DCHECK(memory_used == picture->ApproximateMemoryUsage());
@@ -220,6 +226,11 @@ void RasterizeAndRecordBenchmark::RunOnDisplayListLayer(
do {
display_list = painter->PaintContentsToDisplayList(visible_layer_rect,
painting_control);
+ if (display_list->ShouldBeAnalyzedForSolidColor()) {
+ gfx::Size layer_size = layer->paint_properties().bounds;
+ skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height());
+ display_list->Raster(&canvas, nullptr, gfx::Rect(), 1.f);
+ }
if (memory_used) {
// Verify we are recording the same thing each time.