@@ -28,7 +28,7 @@ TEST_F(BackdropFilterLayerTest, PaintingEmptyLayerDies) {
28
28
auto parent = std::make_shared<ClipRectLayer>(kEmptyRect , Clip::hardEdge);
29
29
parent->Add (layer);
30
30
31
- parent->Preroll (preroll_context (), SkMatrix () );
31
+ parent->Preroll (preroll_context ());
32
32
EXPECT_EQ (layer->paint_bounds (), kEmptyRect );
33
33
EXPECT_EQ (layer->child_paint_bounds (), kEmptyRect );
34
34
EXPECT_FALSE (layer->needs_painting (paint_context ()));
@@ -65,7 +65,8 @@ TEST_F(BackdropFilterLayerTest, EmptyFilter) {
65
65
auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::hardEdge);
66
66
parent->Add (layer);
67
67
68
- parent->Preroll (preroll_context (), initial_transform);
68
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
69
+ parent->Preroll (preroll_context ());
69
70
EXPECT_EQ (layer->paint_bounds (), child_bounds);
70
71
EXPECT_EQ (layer->child_paint_bounds (), child_bounds);
71
72
EXPECT_TRUE (layer->needs_painting (paint_context ()));
@@ -95,7 +96,8 @@ TEST_F(BackdropFilterLayerTest, SimpleFilter) {
95
96
auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::hardEdge);
96
97
parent->Add (layer);
97
98
98
- parent->Preroll (preroll_context (), initial_transform);
99
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
100
+ parent->Preroll (preroll_context ());
99
101
EXPECT_EQ (layer->paint_bounds (), child_bounds);
100
102
EXPECT_EQ (layer->child_paint_bounds (), child_bounds);
101
103
EXPECT_TRUE (layer->needs_painting (paint_context ()));
@@ -125,7 +127,8 @@ TEST_F(BackdropFilterLayerTest, NonSrcOverBlend) {
125
127
auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::hardEdge);
126
128
parent->Add (layer);
127
129
128
- parent->Preroll (preroll_context (), initial_transform);
130
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
131
+ parent->Preroll (preroll_context ());
129
132
EXPECT_EQ (layer->paint_bounds (), child_bounds);
130
133
EXPECT_EQ (layer->child_paint_bounds (), child_bounds);
131
134
EXPECT_TRUE (layer->needs_painting (paint_context ()));
@@ -166,7 +169,8 @@ TEST_F(BackdropFilterLayerTest, MultipleChildren) {
166
169
std::make_shared<ClipRectLayer>(children_bounds, Clip::hardEdge);
167
170
parent->Add (layer);
168
171
169
- parent->Preroll (preroll_context (), initial_transform);
172
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
173
+ parent->Preroll (preroll_context ());
170
174
EXPECT_EQ (mock_layer1->paint_bounds (), child_path1.getBounds ());
171
175
EXPECT_EQ (mock_layer2->paint_bounds (), child_path2.getBounds ());
172
176
EXPECT_EQ (layer->paint_bounds (), children_bounds);
@@ -215,7 +219,9 @@ TEST_F(BackdropFilterLayerTest, Nested) {
215
219
std::make_shared<ClipRectLayer>(children_bounds, Clip::hardEdge);
216
220
parent->Add (layer1);
217
221
218
- parent->Preroll (preroll_context (), initial_transform);
222
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
223
+ parent->Preroll (preroll_context ());
224
+
219
225
EXPECT_EQ (mock_layer1->paint_bounds (), child_path1.getBounds ());
220
226
EXPECT_EQ (mock_layer2->paint_bounds (), child_path2.getBounds ());
221
227
EXPECT_EQ (layer1->paint_bounds (), children_bounds);
@@ -253,27 +259,28 @@ TEST_F(BackdropFilterLayerTest, Readback) {
253
259
auto layer1 = std::make_shared<BackdropFilterLayer>(layer_filter.shared (),
254
260
DlBlendMode::kSrcOver );
255
261
preroll_context ()->surface_needs_readback = false ;
256
- layer1->Preroll (preroll_context (), initial_transform);
262
+ preroll_context ()->state_stack .set_initial_transform (initial_transform);
263
+ layer1->Preroll (preroll_context ());
257
264
EXPECT_TRUE (preroll_context ()->surface_needs_readback );
258
265
259
266
// BDF with no filter does not read from surface itself
260
267
auto layer2 =
261
268
std::make_shared<BackdropFilterLayer>(no_filter, DlBlendMode::kSrcOver );
262
269
preroll_context ()->surface_needs_readback = false ;
263
- layer2->Preroll (preroll_context (), initial_transform );
270
+ layer2->Preroll (preroll_context ());
264
271
EXPECT_FALSE (preroll_context ()->surface_needs_readback );
265
272
266
273
// BDF with no filter does not block prior readback value
267
274
preroll_context ()->surface_needs_readback = true ;
268
- layer2->Preroll (preroll_context (), initial_transform );
275
+ layer2->Preroll (preroll_context ());
269
276
EXPECT_TRUE (preroll_context ()->surface_needs_readback );
270
277
271
278
// BDF with no filter blocks child with readback
272
279
auto mock_layer = std::make_shared<MockLayer>(SkPath (), SkPaint ());
273
280
mock_layer->set_fake_reads_surface (true );
274
281
layer2->Add (mock_layer);
275
282
preroll_context ()->surface_needs_readback = false ;
276
- layer2->Preroll (preroll_context (), initial_transform );
283
+ layer2->Preroll (preroll_context ());
277
284
EXPECT_FALSE (preroll_context ()->surface_needs_readback );
278
285
}
279
286
@@ -292,7 +299,7 @@ TEST_F(BackdropFilterLayerTest, OpacityInheritance) {
292
299
parent->Add (layer);
293
300
clip->Add (parent);
294
301
295
- clip->Preroll (preroll_context (), SkMatrix::I () );
302
+ clip->Preroll (preroll_context ());
296
303
297
304
clip->Paint (display_list_paint_context ());
298
305
0 commit comments