Skip to content

Commit

Permalink
cc: Remove an old unittest trying to verify parameters in PicturePile
Browse files Browse the repository at this point in the history
This was a PictureLayerImpl test verifying the parameters given
to the SkPicture recording backing a PicturePile. But these are
not those days any more. PicturePile in 2016? Nope.

R=vmpstr@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2592183002
Cr-Commit-Position: refs/heads/master@{#440183}
  • Loading branch information
danakj authored and Commit bot committed Dec 21, 2016
1 parent 577ff02 commit 13ed2e6
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions cc/layers/picture_layer_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,72 +289,6 @@ class NoLowResPictureLayerImplTest : public PictureLayerImplTest {
}
};

TEST_F(PictureLayerImplTest, TileGridAlignment) {
// Layer to span 4 raster tiles in x and in y
LayerTreeSettings settings;
gfx::Size layer_size(settings.default_tile_size.width() * 7 / 2,
settings.default_tile_size.height() * 7 / 2);

scoped_refptr<FakeRasterSource> pending_raster_source =
FakeRasterSource::CreateFilled(layer_size);

// Create an active recording source, but make sure it's not solid.
std::unique_ptr<FakeRecordingSource> active_recording_source =
FakeRecordingSource::CreateFilledRecordingSource(layer_size);
active_recording_source->SetLayerBounds(layer_size);
active_recording_source->add_draw_rect(gfx::Rect(layer_size));
active_recording_source->add_draw_rect(
gfx::Rect(0, 0, layer_size.width() - 1, layer_size.height() - 1));
active_recording_source->Rerecord();
scoped_refptr<FakeRasterSource> active_raster_source =
FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(),
false);

SetupTrees(pending_raster_source, active_raster_source);

// Add 1x1 rects at the centers of each tile, then re-record recording source
// contents.
active_layer()->tilings()->tiling_at(0)->CreateAllTilesForTesting();
std::vector<Tile*> tiles =
active_layer()->tilings()->tiling_at(0)->AllTilesForTesting();
EXPECT_EQ(16u, tiles.size());
std::vector<SkRect> rects;
std::vector<Tile*>::const_iterator tile_iter;
active_recording_source->reset_draws();
for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) {
gfx::Point tile_center = (*tile_iter)->content_rect().CenterPoint();
gfx::Rect rect(tile_center.x(), tile_center.y(), 1, 1);
active_recording_source->add_draw_rect(rect);
rects.push_back(SkRect::MakeXYWH(rect.x(), rect.y(), 1, 1));
}

// Force re-raster with newly injected content
active_recording_source->Rerecord();

scoped_refptr<FakeRasterSource> updated_active_raster_source =
FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(),
false);

RasterSource::PlaybackSettings playback_settings;
playback_settings.playback_to_shared_canvas = true;
std::vector<SkRect>::const_iterator rect_iter = rects.begin();
for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) {
MockCanvas mock_canvas(1000, 1000);
const gfx::Rect& content_rect = (*tile_iter)->content_rect();
updated_active_raster_source->RasterSource::PlaybackToCanvas(
&mock_canvas, content_rect, content_rect, gfx::SizeF(1.f, 1.f),
playback_settings);

// This test verifies that when drawing the contents of a specific tile
// at content scale 1.0, the playback canvas never receives content from
// neighboring tiles which indicates that the tile grid embedded in
// SkPicture is perfectly aligned with the compositor's tiles.
EXPECT_EQ(1u, mock_canvas.rects_.size());
EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]);
rect_iter++;
}
}

TEST_F(PictureLayerImplTest, CloneNoInvalidation) {
gfx::Size layer_bounds(400, 400);
SetupDefaultTrees(layer_bounds);
Expand Down

0 comments on commit 13ed2e6

Please sign in to comment.