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

Unified Diff: cc/picture_pile_impl.cc

Issue 12095053: cc: Avoid expensive RenderingStats collection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 11 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.cc ('k') | cc/raster_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_pile_impl.cc
diff --git a/cc/picture_pile_impl.cc b/cc/picture_pile_impl.cc
index 02fabb53baa3cbcb4ebc9212b0cecf3ce708d4ef..233d5248c8c0fb6b07886fb97caaa263a647cb7a 100644
--- a/cc/picture_pile_impl.cc
+++ b/cc/picture_pile_impl.cc
@@ -65,7 +65,9 @@ void PicturePileImpl::Raster(
DCHECK(contents_scale >= min_contents_scale_);
- base::TimeTicks rasterizeBeginTime = base::TimeTicks::Now();
+ base::TimeTicks rasterize_begin_time;
+ if (stats)
+ rasterize_begin_time = base::TimeTicks::Now();
canvas->save();
canvas->translate(-content_rect.x(), -content_rect.y());
@@ -112,13 +114,15 @@ void PicturePileImpl::Raster(
SkRegion::kDifference_Op);
unclipped.Subtract(content_clip);
- stats->totalPixelsRasterized +=
- content_clip.width() * content_clip.height();
+ if (stats)
+ stats->totalPixelsRasterized +=
+ content_clip.width() * content_clip.height();
}
}
canvas->restore();
- stats->totalRasterizeTime += base::TimeTicks::Now() - rasterizeBeginTime;
+ if (stats)
+ stats->totalRasterizeTime += base::TimeTicks::Now() - rasterize_begin_time;
}
void PicturePileImpl::GatherPixelRefs(
« no previous file with comments | « cc/picture_pile.cc ('k') | cc/raster_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698