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

Unified Diff: cc/resources/picture.cc

Issue 12426024: cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 190965 Created 7 years, 9 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.h ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index d3ddc532c89a19e4e7dd0c4cd4f3a08000347f65..9ace4d44cf0229fb0e14693734154b2c73cc7672 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/debug/trace_event.h"
-#include "cc/debug/rendering_stats.h"
+#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/layers/content_layer_client.h"
#include "cc/resources/picture.h"
#include "skia/ext/analysis_canvas.h"
@@ -79,7 +79,7 @@ void Picture::CloneForDrawing(int num_threads) {
}
void Picture::Record(ContentLayerClient* painter,
- RenderingStats* stats,
+ RenderingStatsInstrumentation* stats_instrumentation,
const SkTileGridPicture::TileGridInfo& tile_grid_info) {
TRACE_EVENT2("cc", "Picture::Record",
"width", layer_rect_.width(), "height", layer_rect_.height());
@@ -111,15 +111,13 @@ void Picture::Record(ContentLayerClient* painter,
canvas->drawRect(layer_skrect, paint);
gfx::RectF opaque_layer_rect;
- base::TimeTicks begin_paint_time;
- if (stats)
- begin_paint_time = base::TimeTicks::Now();
+ base::TimeTicks start_time = stats_instrumentation->StartRecording();
+
painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect);
- if (stats) {
- stats->total_paint_time += base::TimeTicks::Now() - begin_paint_time;
- stats->total_pixels_painted +=
- layer_rect_.width() * layer_rect_.height();
- }
+
+ base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
+ stats_instrumentation->AddPaint(duration,
+ layer_rect_.width() * layer_rect_.height());
canvas->restore();
picture_->endRecording();
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698