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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 0a95f317d7203962ba68d997cdc82f7df70c32e8..600f3e24851a20f88b956998bfbe3755c48f2b73 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -278,11 +278,14 @@ class PictureLayerImplTest : public testing::Test {
void ResetTilingsAndRasterScales() {
pending_layer_->ReleaseResources();
+ EXPECT_FALSE(pending_layer_->tilings());
+ pending_layer_->RecreateResources();
+ EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
+
active_layer_->ReleaseResources();
- if (pending_layer_)
- EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
- if (active_layer_)
- EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
+ EXPECT_FALSE(active_layer_->tilings());
+ active_layer_->RecreateResources();
+ EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
}
void AssertAllTilesRequired(PictureLayerTiling* tiling) {
@@ -711,7 +714,7 @@ TEST_F(PictureLayerImplTest, CloneFullInvalidation) {
VerifyAllTilesExistAndHavePile(tilings->tiling_at(i), pending_pile.get());
}
-TEST_F(PictureLayerImplTest, ManageTilingsCreatesTilings) {
+TEST_F(PictureLayerImplTest, UpdateTilesCreatesTilings) {
gfx::Size tile_size(400, 400);
gfx::Size layer_bounds(1300, 1900);
@@ -726,6 +729,8 @@ TEST_F(PictureLayerImplTest, ManageTilingsCreatesTilings) {
EXPECT_LT(low_res_factor, 1.f);
active_layer_->ReleaseResources();
+ EXPECT_FALSE(active_layer_->tilings());
+ active_layer_->RecreateResources();
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
SetupDrawPropertiesAndUpdateTiles(active_layer_,
@@ -796,6 +801,8 @@ TEST_F(PictureLayerImplTest, PendingLayerOnlyHasHighAndLowResTiling) {
EXPECT_LT(low_res_factor, 1.f);
pending_layer_->ReleaseResources();
+ EXPECT_FALSE(pending_layer_->tilings());
+ pending_layer_->RecreateResources();
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
SetupDrawPropertiesAndUpdateTiles(pending_layer_,
@@ -1326,6 +1333,8 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
// Drop resources and recreate them, still the same.
pending_mask->ReleaseResources();
active_mask->ReleaseResources();
+ pending_mask->RecreateResources();
+ active_mask->RecreateResources();
SetupDrawPropertiesAndUpdateTiles(active_mask, 1.f, 1.f, 1.f, 1.f, false);
active_mask->HighResTiling()->CreateAllTilesForTesting();
EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size());
@@ -1369,6 +1378,8 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
// Drop resources and recreate them, still the same.
pending_mask->ReleaseResources();
active_mask->ReleaseResources();
+ pending_mask->RecreateResources();
+ active_mask->RecreateResources();
SetupDrawPropertiesAndUpdateTiles(active_mask, 1.f, 1.f, 1.f, 1.f, false);
active_mask->HighResTiling()->CreateAllTilesForTesting();
EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size());
@@ -1475,8 +1486,12 @@ TEST_F(PictureLayerImplTest, ReleaseResources) {
// All tilings should be removed when losing output surface.
active_layer_->ReleaseResources();
+ EXPECT_FALSE(active_layer_->tilings());
+ active_layer_->RecreateResources();
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
pending_layer_->ReleaseResources();
+ EXPECT_FALSE(pending_layer_->tilings());
+ pending_layer_->RecreateResources();
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
// This should create new tilings.
@@ -3744,8 +3759,12 @@ TEST_F(NoLowResPictureLayerImplTest, ReleaseResources) {
// All tilings should be removed when losing output surface.
active_layer_->ReleaseResources();
+ EXPECT_FALSE(active_layer_->tilings());
+ active_layer_->RecreateResources();
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
pending_layer_->ReleaseResources();
+ EXPECT_FALSE(pending_layer_->tilings());
+ pending_layer_->RecreateResources();
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
// This should create new tilings.
@@ -4644,7 +4663,7 @@ void PictureLayerImplTest::TestQuadsForSolidColor(bool test_for_solid) {
Region invalidation(layer_rect);
recording_source->UpdateAndExpandInvalidation(
&client, &invalidation, false, layer_bounds, layer_rect, frame_number++,
- Picture::RECORD_NORMALLY);
+ RecordingSource::RECORD_NORMALLY);
scoped_refptr<RasterSource> pending_raster_source =
recording_source->CreateRasterSource();
@@ -4707,7 +4726,7 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
Region invalidation1(layer_rect);
recording_source->UpdateAndExpandInvalidation(
&client, &invalidation1, false, layer_bounds, layer_rect, frame_number++,
- Picture::RECORD_NORMALLY);
+ RecordingSource::RECORD_NORMALLY);
scoped_refptr<RasterSource> raster_source1 =
recording_source->CreateRasterSource();
@@ -4725,7 +4744,7 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
Region invalidation2(layer_rect);
recording_source->UpdateAndExpandInvalidation(
&client, &invalidation2, false, layer_bounds, layer_rect, frame_number++,
- Picture::RECORD_NORMALLY);
+ RecordingSource::RECORD_NORMALLY);
scoped_refptr<RasterSource> raster_source2 =
recording_source->CreateRasterSource();
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698