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

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
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/tile_manager.h » ('j') | cc/tile_manager.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_pile_impl.cc
===================================================================
--- cc/picture_pile_impl.cc (revision 170195)
+++ cc/picture_pile_impl.cc (working copy)
@@ -4,7 +4,9 @@
#include "base/debug/trace_event.h"
#include "cc/picture_pile_impl.h"
+#include "cc/rendering_stats.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkSize.h"
namespace cc {
@@ -28,7 +30,10 @@
return clone;
}
-void PicturePileImpl::Raster(SkCanvas* canvas, gfx::Rect rect) {
+void PicturePileImpl::Raster(SkCanvas* canvas, gfx::Rect rect,
+ RenderingStats* stats) {
+ 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());
@@ -39,8 +44,14 @@
if (!pile_[i]->LayerRect().Intersects(rect))
continue;
pile_[i]->Raster(canvas);
+
+ SkISize deviceSize = canvas->getDeviceSize();
+ stats->totalPixelsRasterized += deviceSize.width() * deviceSize.height();
}
canvas->restore();
+
+ stats->totalRasterizeTimeInSeconds += (base::TimeTicks::Now() -
+ rasterizeBeginTime).InSecondsF();
}
} // namespace cc
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/tile_manager.h » ('j') | cc/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698