summaryrefslogtreecommitdiffstats
path: root/cc/resources/picture.cc
diff options
context:
space:
mode:
authoregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 19:58:08 +0000
committeregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 19:58:08 +0000
commit4e5eff7ffc6637da239f91ca43368c5ae1e7eb31 (patch)
treeb68ca79e2ebb68c77efae54689156cb91feb4637 /cc/resources/picture.cc
parent2ddc090ed09703a8b42cdddb556008084e8bfc09 (diff)
downloadchromium_src-4e5eff7ffc6637da239f91ca43368c5ae1e7eb31.zip
chromium_src-4e5eff7ffc6637da239f91ca43368c5ae1e7eb31.tar.gz
chromium_src-4e5eff7ffc6637da239f91ca43368c5ae1e7eb31.tar.bz2
cc: Switch Picture to use RenderingStatsInstrumentation
depends on: https://codereview.chromium.org/13266002/ BUG=181319 Review URL: https://chromiumcodereview.appspot.com/13132005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture.cc')
-rw-r--r--cc/resources/picture.cc31
1 files changed, 12 insertions, 19 deletions
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index 4c85e7d..a3e779d 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -13,7 +13,7 @@
#include "base/values.h"
#include "cc/base/math_util.h"
#include "cc/base/util.h"
-#include "cc/debug/rendering_stats.h"
+#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/debug/traced_picture.h"
#include "cc/debug/traced_value.h"
#include "cc/layers/content_layer_client.h"
@@ -188,7 +188,7 @@ void Picture::CloneForDrawing(int num_threads) {
void Picture::Record(ContentLayerClient* painter,
const SkTileGridPicture::TileGridInfo& tile_grid_info,
- RenderingStats* stats) {
+ RenderingStatsInstrumentation* stats_instrumentation) {
TRACE_EVENT2("cc", "Picture::Record",
"width", layer_rect_.width(),
"height", layer_rect_.height());
@@ -214,15 +214,13 @@ void Picture::Record(ContentLayerClient* painter,
canvas->clipRect(layer_skrect);
gfx::RectF opaque_layer_rect;
- base::TimeTicks begin_record_time;
- if (stats)
- begin_record_time = base::TimeTicks::Now();
+ base::TimeTicks start_time = stats_instrumentation->StartRecording();
+
painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect);
- if (stats) {
- stats->total_record_time += base::TimeTicks::Now() - begin_record_time;
- stats->total_pixels_recorded +=
- 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();
@@ -234,7 +232,7 @@ void Picture::Record(ContentLayerClient* painter,
void Picture::GatherPixelRefs(
const SkTileGridPicture::TileGridInfo& tile_grid_info,
- RenderingStats* stats) {
+ RenderingStatsInstrumentation* stats_instrumentation) {
TRACE_EVENT2("cc", "Picture::GatherPixelRefs",
"width", layer_rect_.width(),
"height", layer_rect_.height());
@@ -253,9 +251,7 @@ void Picture::GatherPixelRefs(
int max_x = 0;
int max_y = 0;
- base::TimeTicks begin_image_gathering_time;
- if (stats)
- begin_image_gathering_time = base::TimeTicks::Now();
+ base::TimeTicks start_time = stats_instrumentation->StartRecording();
skia::LazyPixelRefList pixel_refs;
skia::LazyPixelRefUtils::GatherPixelRefs(picture_.get(), &pixel_refs);
@@ -286,11 +282,8 @@ void Picture::GatherPixelRefs(
max_y = std::max(max_y, max.y());
}
- if (stats) {
- stats->total_image_gathering_time +=
- base::TimeTicks::Now() - begin_image_gathering_time;
- stats->total_image_gathering_count++;
- }
+ base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
+ stats_instrumentation->AddImageGathering(duration);
min_pixel_cell_ = gfx::Point(min_x, min_y);
max_pixel_cell_ = gfx::Point(max_x, max_y);