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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/ui_resource_layer.h » ('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 931e9798545742571fcb9abe3f76e958416e321b..246e62581257c61880f45a78262c8b6a77f80c15 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -1226,6 +1226,15 @@ TEST_F(PictureLayerImplTest, HugeMasksDontGetTiles) {
EXPECT_NE(0u, mask_resource_id);
EXPECT_EQ(mask_texture_size, active_layer_->bounds());
+ // Drop resources and recreate them, still the same.
+ old_pending_layer_->ReleaseResources();
+ active_layer_->ReleaseResources();
+ SetupDrawPropertiesAndUpdateTiles(active_layer_, 1.f, 1.f, 1.f, 1.f, false);
+ active_layer_->HighResTiling()->CreateAllTilesForTesting();
+ EXPECT_EQ(1u, active_layer_->HighResTiling()->AllTilesForTesting().size());
+ EXPECT_NE(0u, mask_resource_id);
+ EXPECT_EQ(mask_texture_size, active_layer_->bounds());
+
// Resize larger than the max texture size.
int max_texture_size = host_impl_.GetRendererCapabilities().max_texture_size;
scoped_refptr<FakePicturePileImpl> huge_pile =
@@ -1249,6 +1258,15 @@ TEST_F(PictureLayerImplTest, HugeMasksDontGetTiles) {
// The mask resource is empty.
active_layer_->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
EXPECT_EQ(0u, mask_resource_id);
+
+ // Drop resources and recreate them, still the same.
+ old_pending_layer_->ReleaseResources();
+ active_layer_->ReleaseResources();
+ SetupDrawPropertiesAndUpdateTiles(active_layer_, 1.f, 1.f, 1.f, 1.f, false);
+ active_layer_->HighResTiling()->CreateAllTilesForTesting();
+ EXPECT_EQ(0u, active_layer_->HighResTiling()->AllTilesForTesting().size());
+ active_layer_->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
+ EXPECT_EQ(0u, mask_resource_id);
}
TEST_F(PictureLayerImplTest, ScaledMaskLayer) {
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/ui_resource_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698