summaryrefslogtreecommitdiffstats
path: root/cc/resources/picture.cc
diff options
context:
space:
mode:
authoregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 02:31:03 +0000
committeregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 02:31:03 +0000
commit944314aa4ab8aa1dbba22a6dbdcfdf96cce20352 (patch)
treeccf648588bf8e3694f536290e95dbf1c646d8aff /cc/resources/picture.cc
parentd461f62c56a00d085fab0072182658a1278eec4d (diff)
downloadchromium_src-944314aa4ab8aa1dbba22a6dbdcfdf96cce20352.zip
chromium_src-944314aa4ab8aa1dbba22a6dbdcfdf96cce20352.tar.gz
chromium_src-944314aa4ab8aa1dbba22a6dbdcfdf96cce20352.tar.bz2
cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation
This change switches all of the remaining RenderingStats collection in composited mode to use RenderinStatsInstrumentation. BUG=181319 Review URL: https://chromiumcodereview.appspot.com/12426024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture.cc')
-rw-r--r--cc/resources/picture.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index d3ddc53..9ace4d4 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();