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

Unified Diff: cc/test/fake_picture_pile_impl.cc

Issue 63443003: cc: Combine analysis and raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: cc/test/fake_picture_pile_impl.cc
diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc
index 989c4f9f7a2bb94bed2976ec20a72103a7cbf1b0..b5bc37a095230bb9f4acdeec3904c29e6bc01aff 100644
--- a/cc/test/fake_picture_pile_impl.cc
+++ b/cc/test/fake_picture_pile_impl.cc
@@ -94,4 +94,26 @@ void FakePicturePileImpl::RerecordPile() {
}
}
+void FakePicturePileImpl::AnalyzeInRect(gfx::Rect content_rect,
+ float contents_scale,
+ Analysis* analysis) {
+ // Create and raster to a bitmap of content_rect size, even though the
+ // analysis_rect may be smaller to simulate edge tiles where recorded content
+ // doesn't cover the entire content_rect.
+ SkBitmap empty_bitmap;
+ empty_bitmap.setConfig(SkBitmap::kNo_Config,
Stephen White 2013/11/07 18:14:22 Nit: I find it a bit weird that this API uses kNo_
enne (OOO) 2013/11/07 22:36:10 If there's a better way to fix this, please let me
+ content_rect.width(),
+ content_rect.height());
+
+ gfx::Rect analysis_rect(
+ AnalysisRectForRaster(content_rect, contents_scale));
+ skia::AnalysisDevice device(empty_bitmap, analysis_rect);
+ skia::AnalysisCanvas canvas(&device);
+
+ RasterDirect(&canvas, content_rect, contents_scale, NULL);
+
+ analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color);
+ analysis->has_text = canvas.HasText();
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698