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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 6 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/layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl.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 8351fc64261d090fb9f1e09ef106458e7ec4d1e0..61ac6bb99b8dd4d47431757071940e6e5532e8dc 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -1144,13 +1144,13 @@ TEST_F(PictureLayerImplTest, DontAddLowResForSmallLayers) {
host_impl()->pending_tree(), 3, pending_raster_source);
mask->SetBounds(layer_bounds);
mask->SetDrawsContent(true);
- pending_layer()->SetMaskLayer(std::move(mask));
+ pending_layer()->test_properties()->SetMaskLayer(std::move(mask));
pending_layer()->SetHasRenderSurface(true);
RebuildPropertyTreesOnPendingTree();
host_impl()->pending_tree()->UpdateDrawProperties(false);
- FakePictureLayerImpl* mask_raw =
- static_cast<FakePictureLayerImpl*>(pending_layer()->mask_layer());
+ FakePictureLayerImpl* mask_raw = static_cast<FakePictureLayerImpl*>(
+ pending_layer()->test_properties()->mask_layer);
// We did an UpdateDrawProperties above, which will set a contents scale on
// the mask layer, so allow us to reset the contents scale.
mask_raw->ReleaseResources();
@@ -1177,7 +1177,7 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
host_impl()->pending_tree(), 3, valid_raster_source);
mask_ptr->SetBounds(layer_bounds);
mask_ptr->SetDrawsContent(true);
- pending_layer()->SetMaskLayer(std::move(mask_ptr));
+ pending_layer()->test_properties()->SetMaskLayer(std::move(mask_ptr));
pending_layer()->test_properties()->force_render_surface = true;
RebuildPropertyTreesOnPendingTree();
@@ -1185,8 +1185,8 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
bool update_lcd_text = false;
host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text);
- FakePictureLayerImpl* pending_mask =
- static_cast<FakePictureLayerImpl*>(pending_layer()->mask_layer());
+ FakePictureLayerImpl* pending_mask = static_cast<FakePictureLayerImpl*>(
+ pending_layer()->test_properties()->mask_layer);
EXPECT_EQ(1.f, pending_mask->HighResTiling()->contents_scale());
EXPECT_EQ(1u, pending_mask->num_tilings());
@@ -1196,8 +1196,8 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
ActivateTree();
- FakePictureLayerImpl* active_mask =
- static_cast<FakePictureLayerImpl*>(active_layer()->mask_layer());
+ FakePictureLayerImpl* active_mask = static_cast<FakePictureLayerImpl*>(
+ host_impl()->active_tree()->LayerById(pending_mask->id()));
// Mask layers have a tiling with a single tile in it.
EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size());
@@ -1307,7 +1307,7 @@ TEST_F(PictureLayerImplTest, ScaledMaskLayer) {
host_impl()->pending_tree(), 3, valid_raster_source);
mask_ptr->SetBounds(layer_bounds);
mask_ptr->SetDrawsContent(true);
- pending_layer()->SetMaskLayer(std::move(mask_ptr));
+ pending_layer()->test_properties()->SetMaskLayer(std::move(mask_ptr));
pending_layer()->test_properties()->force_render_surface = true;
RebuildPropertyTreesOnPendingTree();
@@ -1315,8 +1315,8 @@ TEST_F(PictureLayerImplTest, ScaledMaskLayer) {
bool update_lcd_text = false;
host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text);
- FakePictureLayerImpl* pending_mask =
- static_cast<FakePictureLayerImpl*>(pending_layer()->mask_layer());
+ FakePictureLayerImpl* pending_mask = static_cast<FakePictureLayerImpl*>(
+ pending_layer()->test_properties()->mask_layer);
// Masks are scaled, and do not have a low res tiling.
EXPECT_EQ(1.3f, pending_mask->HighResTiling()->contents_scale());
@@ -1327,8 +1327,8 @@ TEST_F(PictureLayerImplTest, ScaledMaskLayer) {
ActivateTree();
- FakePictureLayerImpl* active_mask =
- static_cast<FakePictureLayerImpl*>(active_layer()->mask_layer());
+ FakePictureLayerImpl* active_mask = static_cast<FakePictureLayerImpl*>(
+ host_impl()->active_tree()->LayerById(pending_mask->id()));
// Mask layers have a tiling with a single tile in it.
EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size());
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698