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

Unified Diff: cc/tile_manager.cc

Issue 12191006: Add picture pile raster times histogram (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed HighResNow to Now Created 7 years, 10 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/picture_pile_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_manager.cc
diff --git a/cc/tile_manager.cc b/cc/tile_manager.cc
index 9935de5d2e84e1a130b685ac8ef0864213a46ae0..83c0ab2b235d2f557631804d14967b174ae1e1bb 100644
--- a/cc/tile_manager.cc
+++ b/cc/tile_manager.cc
@@ -10,6 +10,7 @@
#include "base/debug/trace_event.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "cc/platform_color.h"
#include "cc/raster_worker_pool.h"
#include "cc/resource_pool.h"
@@ -762,7 +763,23 @@ void TileManager::RunRasterTask(uint8* buffer,
bitmap.setPixels(buffer);
SkDevice device(bitmap);
SkCanvas canvas(&device);
+
+ base::TimeTicks begin_time;
+ if (stats)
+ begin_time = base::TimeTicks::Now();
+
picture_pile->Raster(&canvas, rect, contents_scale, stats);
+
+ if (stats) {
+ base::TimeTicks end_time = base::TimeTicks::Now();
+ base::TimeDelta duration = end_time - begin_time;
danakj 2013/02/04 18:56:24 nit: i think i'd drop the "duration" variable, I d
+ stats->totalRasterizeTime += duration;
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Renderer4.PictureRasterTimeMS",
+ duration.InMilliseconds(),
+ 0, 10, 10
+ );
+ }
}
// static
« no previous file with comments | « cc/picture_pile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698