Chromium Code Reviews| Index: cc/resources/picture_pile_impl.cc |
| diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc |
| index 44a52b8afd71d20a0fd3158e6a5ba367f4a1af7f..c540f6cafd1e51ae18dac0dcf9f0d65ed6f622e5 100644 |
| --- a/cc/resources/picture_pile_impl.cc |
| +++ b/cc/resources/picture_pile_impl.cc |
| @@ -74,19 +74,11 @@ void PicturePileImpl::RasterDirect( |
| float contents_scale, |
| RenderingStatsInstrumentation* rendering_stats_instrumentation) { |
| RasterCommon(canvas, |
| - NULL, |
| canvas_rect, |
| contents_scale, |
| rendering_stats_instrumentation); |
| } |
| -void PicturePileImpl::RasterForAnalysis( |
| - skia::AnalysisCanvas* canvas, |
| - gfx::Rect canvas_rect, |
| - float contents_scale) { |
| - RasterCommon(canvas, canvas, canvas_rect, contents_scale, NULL); |
| -} |
| - |
| void PicturePileImpl::RasterToBitmap( |
| SkCanvas* canvas, |
| gfx::Rect canvas_rect, |
| @@ -135,7 +127,6 @@ void PicturePileImpl::RasterToBitmap( |
| } |
| RasterCommon(canvas, |
|
vangelis
2013/11/08 23:44:08
Since we can no longer make use of the early-abort
enne (OOO)
2013/11/08 23:48:01
I'm not sure it's worth the complication. I didn'
|
| - NULL, |
| canvas_rect, |
| contents_scale, |
| rendering_stats_instrumentation); |
| @@ -201,7 +192,6 @@ void PicturePileImpl::CoalesceRasters(gfx::Rect canvas_rect, |
| void PicturePileImpl::RasterCommon( |
| SkCanvas* canvas, |
| - SkDrawPictureCallback* callback, |
| gfx::Rect canvas_rect, |
| float contents_scale, |
| RenderingStatsInstrumentation* rendering_stats_instrumentation) { |
| @@ -250,7 +240,7 @@ void PicturePileImpl::RasterCommon( |
| start_time = rendering_stats_instrumentation->StartRecording(); |
| rasterized_pixel_count = picture->Raster( |
| - canvas, callback, negated_clip_region, contents_scale); |
| + canvas, negated_clip_region, contents_scale); |
| if (rendering_stats_instrumentation) { |
| base::TimeDelta duration = |
| @@ -297,30 +287,6 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() { |
| return picture; |
| } |
| -void PicturePileImpl::AnalyzeInRect(gfx::Rect content_rect, |
| - float contents_scale, |
| - PicturePileImpl::Analysis* analysis) { |
| - DCHECK(analysis); |
| - TRACE_EVENT0("cc", "PicturePileImpl::AnalyzeInRect"); |
| - |
| - gfx::Rect layer_rect = gfx::ScaleToEnclosingRect( |
| - content_rect, 1.0f / contents_scale); |
| - |
| - layer_rect.Intersect(gfx::Rect(tiling_.total_size())); |
| - |
| - SkBitmap empty_bitmap; |
| - empty_bitmap.setConfig(SkBitmap::kNo_Config, |
| - layer_rect.width(), |
| - layer_rect.height()); |
| - skia::AnalysisDevice device(empty_bitmap); |
| - skia::AnalysisCanvas canvas(&device); |
| - |
| - RasterForAnalysis(&canvas, layer_rect, 1.0f); |
| - |
| - analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color); |
| - analysis->has_text = canvas.HasText(); |
| -} |
| - |
| PicturePileImpl::Analysis::Analysis() |
| : is_solid_color(false), |
| has_text(false) { |
| @@ -376,6 +342,19 @@ void PicturePileImpl::PixelRefIterator::AdvanceToTilePictureWithPixelRefs() { |
| } |
| } |
| +gfx::Rect PicturePileImpl::AnalysisRectForRaster(gfx::Rect content_rect, |
| + float contents_scale) const { |
| + // Bound the analysis rect to just the pile content. |
| + gfx::Rect content_bounds( |
| + gfx::ScaleToEnclosingRect(gfx::Rect(size()), contents_scale)); |
| + gfx::Rect analysis_rect(content_rect); |
| + analysis_rect.Intersect(content_bounds); |
| + // Move to canvas space. |
| + analysis_rect.set_origin(gfx::Point()); |
| + |
| + return analysis_rect; |
| +} |
| + |
| void PicturePileImpl::DidBeginTracing() { |
| gfx::Rect layer_rect(tiling_.total_size()); |
| std::set<void*> processed_pictures; |