summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authoregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 08:43:56 +0000
committeregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 08:43:56 +0000
commit89574e69fc34fef85419adfd10cbc9b64fd53e00 (patch)
treee44ac8ef7e452e595c6c4a0aa539a3c95cc9a35f /cc
parent1e62dfcf98c751c52ce1c824ee7503cb5db795aa (diff)
downloadchromium_src-89574e69fc34fef85419adfd10cbc9b64fd53e00.zip
chromium_src-89574e69fc34fef85419adfd10cbc9b64fd53e00.tar.gz
chromium_src-89574e69fc34fef85419adfd10cbc9b64fd53e00.tar.bz2
cc: Switch ContentLayerUpdater to use RenderingStatsInstrumentation
depends on: https://codereview.chromium.org/13266002/ BUG=181319 Review URL: https://chromiumcodereview.appspot.com/13265003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/resources/bitmap_content_layer_updater.cc9
-rw-r--r--cc/resources/bitmap_skpicture_content_layer_updater.cc29
-rw-r--r--cc/resources/content_layer_updater.cc18
3 files changed, 31 insertions, 25 deletions
diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc
index 35d3bb5..db982e5 100644
--- a/cc/resources/bitmap_content_layer_updater.cc
+++ b/cc/resources/bitmap_content_layer_updater.cc
@@ -63,10 +63,11 @@ void BitmapContentLayerUpdater::PrepareToUpdate(
canvas_size_.width(), canvas_size_.height(), opaque_));
}
- if (stats) {
- stats->total_pixels_rasterized +=
- content_rect.width() * content_rect.height();
- }
+ // TODO: Clarify if this needs to be saved here. crbug.com/223693
+ rendering_stats_instrumentation_->AddRaster(
+ base::TimeDelta(),
+ content_rect.width() * content_rect.height(),
+ false);
PaintContents(canvas_.get(),
content_rect,
diff --git a/cc/resources/bitmap_skpicture_content_layer_updater.cc b/cc/resources/bitmap_skpicture_content_layer_updater.cc
index 1a2ebee..8ab2743 100644
--- a/cc/resources/bitmap_skpicture_content_layer_updater.cc
+++ b/cc/resources/bitmap_skpicture_content_layer_updater.cc
@@ -31,12 +31,8 @@ void BitmapSkPictureContentLayerUpdater::Resource::Update(
bitmap_.setIsOpaque(updater_->layer_is_opaque());
SkDevice device(bitmap_);
SkCanvas canvas(&device);
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
+
updater_->PaintContentsRect(&canvas, source_rect, stats);
- if (stats)
- stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time;
ResourceUpdate upload = ResourceUpdate::Create(
texture(), &bitmap_, source_rect, source_rect, dest_offset);
@@ -76,16 +72,21 @@ void BitmapSkPictureContentLayerUpdater::PaintContentsRect(
// Translate the origin of content_rect to that of source_rect.
canvas->translate(content_rect().x() - source_rect.x(),
content_rect().y() - source_rect.y());
- base::TimeTicks rasterize_begin_time;
- if (stats)
- rasterize_begin_time = base::TimeTicks::Now();
+
+ base::TimeTicks start_time =
+ rendering_stats_instrumentation_->StartRecording();
+
DrawPicture(canvas);
- if (stats) {
- stats->total_rasterize_time +=
- base::TimeTicks::Now() - rasterize_begin_time;
- stats->total_pixels_rasterized +=
- source_rect.width() * source_rect.height();
- }
+
+ base::TimeDelta duration =
+ rendering_stats_instrumentation_->EndRecording(start_time);
+ rendering_stats_instrumentation_->AddRaster(
+ duration,
+ source_rect.width() * source_rect.height(),
+ false);
+
+ // TODO: Clarify if this needs to be saved here. crbug.com/223693
+ rendering_stats_instrumentation_->AddPaint(duration, 0);
}
} // namespace cc
diff --git a/cc/resources/content_layer_updater.cc b/cc/resources/content_layer_updater.cc
index 0651e87..d242ae9 100644
--- a/cc/resources/content_layer_updater.cc
+++ b/cc/resources/content_layer_updater.cc
@@ -56,14 +56,18 @@ void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
canvas->clipRect(layer_sk_rect);
gfx::RectF opaque_layer_rect;
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
+
+ base::TimeTicks start_time =
+ rendering_stats_instrumentation_->StartRecording();
+
painter_->Paint(canvas, layer_rect, &opaque_layer_rect);
- if (stats) {
- stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time;
- stats->total_pixels_painted += content_rect.width() * content_rect.height();
- }
+
+ base::TimeDelta duration =
+ rendering_stats_instrumentation_->EndRecording(start_time);
+ rendering_stats_instrumentation_->AddPaint(
+ duration,
+ content_rect.width() * content_rect.height());
+
canvas->restore();
gfx::RectF opaque_content_rect = gfx::ScaleRect(