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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 74713006: cc: Include analysis in raster benchmark costs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix presubmit warning Created 7 years 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/resources/picture_pile_impl.h ('k') | cc/resources/raster_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698