| Index: cc/resources/picture_pile_impl.cc
|
| diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
|
| index 552218695e5006d2fa1579bfd0d3c22d933ab66c..ca160b5f812884a32c476555d1edd05c301f18df 100644
|
| --- a/cc/resources/picture_pile_impl.cc
|
| +++ b/cc/resources/picture_pile_impl.cc
|
| @@ -77,14 +77,17 @@ void PicturePileImpl::RasterDirect(
|
| NULL,
|
| canvas_rect,
|
| contents_scale,
|
| - rendering_stats_instrumentation);
|
| + rendering_stats_instrumentation,
|
| + false);
|
| }
|
|
|
| void PicturePileImpl::RasterForAnalysis(
|
| skia::AnalysisCanvas* canvas,
|
| gfx::Rect canvas_rect,
|
| - float contents_scale) {
|
| - RasterCommon(canvas, canvas, canvas_rect, contents_scale, NULL);
|
| + float contents_scale,
|
| + RenderingStatsInstrumentation* stats_instrumentation) {
|
| + RasterCommon(
|
| + canvas, canvas, canvas_rect, contents_scale, stats_instrumentation, true);
|
| }
|
|
|
| void PicturePileImpl::RasterToBitmap(
|
| @@ -138,7 +141,8 @@ void PicturePileImpl::RasterToBitmap(
|
| NULL,
|
| canvas_rect,
|
| contents_scale,
|
| - rendering_stats_instrumentation);
|
| + rendering_stats_instrumentation,
|
| + false);
|
| }
|
|
|
| void PicturePileImpl::CoalesceRasters(gfx::Rect canvas_rect,
|
| @@ -205,7 +209,8 @@ void PicturePileImpl::RasterCommon(
|
| SkDrawPictureCallback* callback,
|
| gfx::Rect canvas_rect,
|
| float contents_scale,
|
| - RenderingStatsInstrumentation* rendering_stats_instrumentation) {
|
| + RenderingStatsInstrumentation* rendering_stats_instrumentation,
|
| + bool is_analysis) {
|
| DCHECK(contents_scale >= min_contents_scale_);
|
|
|
| canvas->translate(-canvas_rect.x(), -canvas_rect.y());
|
| @@ -261,8 +266,13 @@ void PicturePileImpl::RasterCommon(
|
| }
|
|
|
| if (rendering_stats_instrumentation) {
|
| - rendering_stats_instrumentation->AddRaster(best_duration,
|
| - rasterized_pixel_count);
|
| + if (is_analysis) {
|
| + rendering_stats_instrumentation->AddAnalysis(best_duration,
|
| + rasterized_pixel_count);
|
| + } else {
|
| + rendering_stats_instrumentation->AddRaster(best_duration,
|
| + rasterized_pixel_count);
|
| + }
|
| }
|
| }
|
|
|
| @@ -298,9 +308,18 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
|
| return picture;
|
| }
|
|
|
| -void PicturePileImpl::AnalyzeInRect(gfx::Rect content_rect,
|
| - float contents_scale,
|
| - PicturePileImpl::Analysis* analysis) {
|
| +void PicturePileImpl::AnalyzeInRect(
|
| + gfx::Rect content_rect,
|
| + float contents_scale,
|
| + PicturePileImpl::Analysis* analysis) {
|
| + AnalyzeInRect(content_rect, contents_scale, analysis, NULL);
|
| +}
|
| +
|
| +void PicturePileImpl::AnalyzeInRect(
|
| + gfx::Rect content_rect,
|
| + float contents_scale,
|
| + PicturePileImpl::Analysis* analysis,
|
| + RenderingStatsInstrumentation* stats_instrumentation) {
|
| DCHECK(analysis);
|
| TRACE_EVENT0("cc", "PicturePileImpl::AnalyzeInRect");
|
|
|
| @@ -316,7 +335,7 @@ void PicturePileImpl::AnalyzeInRect(gfx::Rect content_rect,
|
| skia::AnalysisDevice device(empty_bitmap);
|
| skia::AnalysisCanvas canvas(&device);
|
|
|
| - RasterForAnalysis(&canvas, layer_rect, 1.0f);
|
| + RasterForAnalysis(&canvas, layer_rect, 1.0f, stats_instrumentation);
|
|
|
| analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color);
|
| analysis->has_text = canvas.HasText();
|
|
|