Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: cc/resources/raster_worker_pool.cc

Issue 25353009: telemetry: Refactored rasterize_and_record measurement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made BenchmarkInstrumentation a class. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/raster_worker_pool.cc
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index e7f19075f6b25fb21d2e05606f1ad274299a91ce..b7dd504abc85d749709f927130085b8d7025e16d 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -7,7 +7,6 @@
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "base/values.h"
-#include "cc/debug/benchmark_instrumentation.h"
#include "cc/debug/devtools_instrumentation.h"
#include "cc/debug/traced_value.h"
#include "cc/resources/picture_pile_impl.h"
@@ -103,9 +102,8 @@ class RasterWorkerPoolTaskImpl : public internal::RasterWorkerPoolTask {
gfx::Size size,
int stride) {
TRACE_EVENT2(
- benchmark_instrumentation::kCategory,
- benchmark_instrumentation::kRunRasterOnThread,
- benchmark_instrumentation::kData,
+ "cc", "RasterWorkerPoolTaskImpl::RunRasterOnThread",
+ "data",
TracedValue::FromValue(DataAsValue().release()),
"raster_mode",
TracedValue::FromValue(RasterModeAsValue(raster_mode_).release()));
@@ -166,14 +164,23 @@ class RasterWorkerPoolTaskImpl : public internal::RasterWorkerPoolTask {
canvas.setDrawFilter(draw_filter.get());
base::TimeDelta prev_rasterize_time =
- rendering_stats_->GetImplThreadRenderingStats().rasterize_time;
-
- picture_clone->RasterToBitmap(
- &canvas, content_rect_, contents_scale_, rendering_stats_);
+ rendering_stats_->impl_thread_rendering_stats().rasterize_time;
+
+ // Only record rasterization time for highres tiles, because
+ // lowres tiles are not required for activation and therefore
+ // introduce noise in the measurement (sometimes they get rasterized
+ // before we draw and sometimes they aren't)
+ if (tile_resolution_ == HIGH_RESOLUTION) {
+ picture_clone->RasterToBitmap(
+ &canvas, content_rect_, contents_scale_, rendering_stats_);
+ } else {
+ picture_clone->RasterToBitmap(
+ &canvas, content_rect_, contents_scale_, NULL);
+ }
if (rendering_stats_->record_rendering_stats()) {
base::TimeDelta current_rasterize_time =
- rendering_stats_->GetImplThreadRenderingStats().rasterize_time;
+ rendering_stats_->impl_thread_rendering_stats().rasterize_time;
HISTOGRAM_CUSTOM_COUNTS(
"Renderer4.PictureRasterTimeUS",
(current_rasterize_time - prev_rasterize_time).InMicroseconds(),
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698