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

Unified Diff: cc/picture_pile.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.cc
===================================================================
--- cc/picture_pile.cc (revision 170195)
+++ cc/picture_pile.cc (working copy)
@@ -4,8 +4,10 @@
#include <algorithm>
+#include "base/time.h"
#include "cc/picture_pile.h"
#include "cc/picture_pile_impl.h"
+#include "cc/rendering_stats.h"
namespace cc {
@@ -38,6 +40,8 @@
ContentLayerClient* painter,
const Region&,
RenderingStats& stats) {
+ base::TimeTicks paintBeginTime = base::TimeTicks::Now();
+
// TODO(enne): Add things to the pile, consolidate if needed, etc...
// TODO(enne): Only re-record invalidated areas.
// TODO(enne): Also re-record areas that have been newly exposed by resize.
@@ -47,6 +51,9 @@
pile_.clear();
pile_.push_back(Picture::Create());
pile_[0]->Record(painter, gfx::Rect(gfx::Point(), size_), stats);
+
+ stats.totalPaintTimeInSeconds += (base::TimeTicks::Now() -
nduca 2012/11/29 18:16:30 Lets move this into accounting Picture::Record
Tom Hudson 2012/11/29 19:16:11 D'oh! Picture::Record already does it, so this was
+ paintBeginTime).InSecondsF();
nduca 2012/11/29 18:16:30 i think we also need to track the number of pixels
Tom Hudson 2012/11/29 19:16:11 Done.
}
void PicturePile::PushPropertiesTo(PicturePileImpl* other) {
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/picture_pile_impl.h » ('j') | cc/picture_pile_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698