| Index: cc/resources/picture_pile_impl_unittest.cc
|
| diff --git a/cc/resources/picture_pile_impl_unittest.cc b/cc/resources/picture_pile_impl_unittest.cc
|
| index 0ced279777d9433d8a7ab5509018151694d4bd13..f4fd5a976d6623964a5df7cbbfd6e901ff80b273 100644
|
| --- a/cc/resources/picture_pile_impl_unittest.cc
|
| +++ b/cc/resources/picture_pile_impl_unittest.cc
|
| @@ -37,9 +37,9 @@ TEST(PicturePileImplTest, AnalyzeIsSolidUnscaled) {
|
| // Ensure everything is solid
|
| for (int y = 0; y <= 300; y += 100) {
|
| for (int x = 0; x <= 300; x += 100) {
|
| - PicturePileImpl::Analysis analysis;
|
| + RasterSource::SolidColorAnalysis analysis;
|
| gfx::Rect rect(x, y, 100, 100);
|
| - pile->AnalyzeInRect(rect, 1.0, &analysis);
|
| + pile->AnalyzeInRect(rect, 1.0, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color) << rect.ToString();
|
| EXPECT_EQ(analysis.solid_color, solid_color) << rect.ToString();
|
| }
|
| @@ -49,27 +49,27 @@ TEST(PicturePileImplTest, AnalyzeIsSolidUnscaled) {
|
| pile->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1), non_solid_paint);
|
| pile->RerecordPile();
|
|
|
| - PicturePileImpl::Analysis analysis;
|
| - pile->AnalyzeInRect(gfx::Rect(0, 0, 100, 100), 1.0, &analysis);
|
| + RasterSource::SolidColorAnalysis analysis;
|
| + pile->AnalyzeInRect(gfx::Rect(0, 0, 100, 100), 1.0, &analysis, nullptr);
|
| EXPECT_FALSE(analysis.is_solid_color);
|
|
|
| - pile->AnalyzeInRect(gfx::Rect(100, 0, 100, 100), 1.0, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(100, 0, 100, 100), 1.0, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| // Boundaries should be clipped
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(350, 0, 100, 100), 1.0, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(350, 0, 100, 100), 1.0, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(0, 350, 100, 100), 1.0, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(0, 350, 100, 100), 1.0, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(350, 350, 100, 100), 1.0, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(350, 350, 100, 100), 1.0, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
| }
|
| @@ -95,9 +95,9 @@ TEST(PicturePileImplTest, AnalyzeIsSolidScaled) {
|
| // Ensure everything is solid
|
| for (int y = 0; y <= 30; y += 10) {
|
| for (int x = 0; x <= 30; x += 10) {
|
| - PicturePileImpl::Analysis analysis;
|
| + RasterSource::SolidColorAnalysis analysis;
|
| gfx::Rect rect(x, y, 10, 10);
|
| - pile->AnalyzeInRect(rect, 0.1f, &analysis);
|
| + pile->AnalyzeInRect(rect, 0.1f, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color) << rect.ToString();
|
| EXPECT_EQ(analysis.solid_color, solid_color) << rect.ToString();
|
| }
|
| @@ -107,27 +107,27 @@ TEST(PicturePileImplTest, AnalyzeIsSolidScaled) {
|
| pile->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1), non_solid_paint);
|
| pile->RerecordPile();
|
|
|
| - PicturePileImpl::Analysis analysis;
|
| - pile->AnalyzeInRect(gfx::Rect(0, 0, 10, 10), 0.1f, &analysis);
|
| + RasterSource::SolidColorAnalysis analysis;
|
| + pile->AnalyzeInRect(gfx::Rect(0, 0, 10, 10), 0.1f, &analysis, nullptr);
|
| EXPECT_FALSE(analysis.is_solid_color);
|
|
|
| - pile->AnalyzeInRect(gfx::Rect(10, 0, 10, 10), 0.1f, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(10, 0, 10, 10), 0.1f, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| // Boundaries should be clipped
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(35, 0, 10, 10), 0.1f, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(35, 0, 10, 10), 0.1f, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(0, 35, 10, 10), 0.1f, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(0, 35, 10, 10), 0.1f, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
|
|
| analysis.is_solid_color = false;
|
| - pile->AnalyzeInRect(gfx::Rect(35, 35, 10, 10), 0.1f, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(35, 35, 10, 10), 0.1f, &analysis, nullptr);
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, solid_color);
|
| }
|
| @@ -138,10 +138,10 @@ TEST(PicturePileImplTest, AnalyzeIsSolidEmpty) {
|
|
|
| scoped_refptr<FakePicturePileImpl> pile =
|
| FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
|
| - PicturePileImpl::Analysis analysis;
|
| + RasterSource::SolidColorAnalysis analysis;
|
| EXPECT_FALSE(analysis.is_solid_color);
|
|
|
| - pile->AnalyzeInRect(gfx::Rect(0, 0, 400, 400), 1.f, &analysis);
|
| + pile->AnalyzeInRect(gfx::Rect(0, 0, 400, 400), 1.f, &analysis, nullptr);
|
|
|
| EXPECT_TRUE(analysis.is_solid_color);
|
| EXPECT_EQ(analysis.solid_color, SkColorSetARGB(0, 0, 0, 0));
|
| @@ -687,10 +687,10 @@ TEST_P(FullContentsTest, RasterFullContents) {
|
|
|
| FakeRenderingStatsInstrumentation rendering_stats_instrumentation;
|
|
|
| - pile->RasterToBitmap(&canvas,
|
| - canvas_rect,
|
| - contents_scale,
|
| - &rendering_stats_instrumentation);
|
| + pile->PlaybackToCanvas(&canvas,
|
| + canvas_rect,
|
| + contents_scale,
|
| + &rendering_stats_instrumentation);
|
|
|
| SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels());
|
| int num_pixels = bitmap.width() * bitmap.height();
|
| @@ -738,7 +738,7 @@ TEST(PicturePileImpl, RasterContentsTransparent) {
|
| SkCanvas canvas(bitmap);
|
|
|
| FakeRenderingStatsInstrumentation rendering_stats_instrumentation;
|
| - pile->RasterToBitmap(
|
| + pile->PlaybackToCanvas(
|
| &canvas, canvas_rect, contents_scale, &rendering_stats_instrumentation);
|
|
|
| SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels());
|
| @@ -784,10 +784,10 @@ TEST_P(OverlapTest, NoOverlap) {
|
| SkCanvas canvas(bitmap);
|
|
|
| FakeRenderingStatsInstrumentation rendering_stats_instrumentation;
|
| - pile->RasterToBitmap(&canvas,
|
| - gfx::Rect(content_bounds),
|
| - contents_scale,
|
| - &rendering_stats_instrumentation);
|
| + pile->PlaybackToCanvas(&canvas,
|
| + gfx::Rect(content_bounds),
|
| + contents_scale,
|
| + &rendering_stats_instrumentation);
|
|
|
| for (int y = 0; y < bitmap.height(); y++) {
|
| for (int x = 0; x < bitmap.width(); x++) {
|
|
|