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

Unified Diff: cc/picture_pile_impl.cc

Issue 11434033: Track the cost of impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
Index: cc/picture_pile_impl.cc
===================================================================
--- cc/picture_pile_impl.cc (revision 170195)
+++ cc/picture_pile_impl.cc (working copy)
@@ -12,7 +12,8 @@
return make_scoped_refptr(new PicturePileImpl());
}
-PicturePileImpl::PicturePileImpl() {
+PicturePileImpl::PicturePileImpl() :
+ rasterize_time_in_seconds_(0) {
}
PicturePileImpl::~PicturePileImpl() {
@@ -29,6 +30,8 @@
}
void PicturePileImpl::Raster(SkCanvas* canvas, gfx::Rect rect) {
nduca 2012/11/29 18:16:30 Lets pass in a ref to Stats object and accumulate
Tom Hudson 2012/11/29 19:16:11 I hit "Done" when I was working in PicturePileImpl
reveman 2012/11/29 19:27:03 you can allocate storage for the stat in TileManag
+ base::TimeTicks rasterizeBeginTime = base::TimeTicks::Now();
+
// TODO(enne): do this more efficiently, i.e. top down with Skia clips
canvas->save();
canvas->translate(-rect.x(), -rect.y());
@@ -41,6 +44,12 @@
pile_[i]->Raster(canvas);
}
canvas->restore();
+
+ rasterize_time_in_seconds_ += (base::TimeTicks::Now() - rasterizeBeginTime).InSecondsF();
}
+double PicturePileImpl::rasterizeTime() {
+ return rasterize_time_in_seconds_;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698