Flutter Engine
 
Loading...
Searching...
No Matches
backdrop_filter_layer_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
13#include "flutter/fml/macros.h"
14
15namespace flutter {
16namespace testing {
17
19
20#ifndef NDEBUG
21TEST_F(BackdropFilterLayerTest, PaintingEmptyLayerDies) {
23 auto layer =
24 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver);
25 auto parent = std::make_shared<ClipRectLayer>(DlRect(), Clip::kHardEdge);
26 parent->Add(layer);
27
28 parent->Preroll(preroll_context());
29 EXPECT_EQ(layer->paint_bounds(), DlRect());
30 EXPECT_EQ(layer->child_paint_bounds(), DlRect());
31 EXPECT_FALSE(layer->needs_painting(paint_context()));
32
33 EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
34 "needs_painting\\(context\\)");
35}
36
37TEST_F(BackdropFilterLayerTest, PaintBeforePrerollDies) {
38 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f);
39 const DlPath child_path = DlPath::MakeRect(child_bounds);
40 auto mock_layer = std::make_shared<MockLayer>(child_path);
42 auto layer =
43 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver);
44 layer->Add(mock_layer);
45
46 EXPECT_EQ(layer->paint_bounds(), DlRect());
47 EXPECT_EQ(layer->child_paint_bounds(), DlRect());
48 EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
49 "needs_painting\\(context\\)");
50}
51#endif
52
54 const DlMatrix initial_transform = DlMatrix::MakeTranslation({0.5f, 1.0f});
55 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f);
56 const DlPath child_path = DlPath::MakeRect(child_bounds);
57 const DlPaint child_paint = DlPaint(DlColor::kYellow());
58 auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
59 auto layer =
60 std::make_shared<BackdropFilterLayer>(nullptr, DlBlendMode::kSrcOver);
61 layer->Add(mock_layer);
62 auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::kHardEdge);
63 parent->Add(layer);
64
65 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
66 parent->Preroll(preroll_context());
67 EXPECT_EQ(layer->paint_bounds(), child_bounds);
68 EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
69 EXPECT_TRUE(layer->needs_painting(paint_context()));
70 EXPECT_EQ(mock_layer->parent_matrix(), initial_transform);
71
72 parent->Paint(display_list_paint_context());
73 DisplayListBuilder expected_builder;
74 /* (ClipRect)parent::Paint */ {
75 expected_builder.Save();
76 {
77 expected_builder.ClipRect(child_bounds, DlClipOp::kIntersect, false);
78 /* (BackdropFilter)layer::Paint */ {
79 expected_builder.Save();
80 {
81 expected_builder.SaveLayer(child_bounds, nullptr, nullptr);
82 {
83 /* mock_layer::Paint */ {
84 expected_builder.DrawPath(child_path, child_paint);
85 }
86 }
87 expected_builder.Restore();
88 }
89 expected_builder.Restore();
90 }
91 }
92 expected_builder.Restore();
93 }
94 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
95}
96
98 const DlMatrix initial_transform = DlMatrix::MakeTranslation({0.5f, 1.0f});
99 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f);
100 const DlPath child_path = DlPath::MakeRect(child_bounds);
101 const DlPaint child_paint = DlPaint(DlColor::kYellow());
102 auto layer_filter = DlImageFilter::MakeBlur(2.5, 3.2, DlTileMode::kClamp);
103 auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
104 auto layer = std::make_shared<BackdropFilterLayer>(layer_filter,
105 DlBlendMode::kSrcOver);
106 layer->Add(mock_layer);
107 auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::kHardEdge);
108 parent->Add(layer);
109
110 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
111 parent->Preroll(preroll_context());
112 EXPECT_EQ(layer->paint_bounds(), child_bounds);
113 EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
114 EXPECT_TRUE(layer->needs_painting(paint_context()));
115 EXPECT_EQ(mock_layer->parent_matrix(), initial_transform);
116
117 parent->Paint(display_list_paint_context());
118 DisplayListBuilder expected_builder;
119 /* (ClipRect)parent::Paint */ {
120 expected_builder.Save();
121 {
122 expected_builder.ClipRect(child_bounds, DlClipOp::kIntersect, false);
123 /* (BackdropFilter)layer::Paint */ {
124 expected_builder.Save();
125 {
126 expected_builder.SaveLayer(child_bounds, nullptr, layer_filter.get());
127 {
128 /* mock_layer::Paint */ {
129 expected_builder.DrawPath(child_path, child_paint);
130 }
131 }
132 expected_builder.Restore();
133 }
134 expected_builder.Restore();
135 }
136 }
137 expected_builder.Restore();
138 }
139 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
140}
141
143 const DlMatrix initial_transform = DlMatrix::MakeTranslation({0.5f, 1.0f});
144 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 20.5f, 21.5f);
145 const DlPath child_path = DlPath::MakeRect(child_bounds);
146 const DlPaint child_paint = DlPaint(DlColor::kYellow());
147 auto layer_filter = DlImageFilter::MakeBlur(2.5, 3.2, DlTileMode::kClamp);
148 auto mock_layer = std::make_shared<MockLayer>(child_path, child_paint);
149 auto layer =
150 std::make_shared<BackdropFilterLayer>(layer_filter, DlBlendMode::kSrc);
151 layer->Add(mock_layer);
152 auto parent = std::make_shared<ClipRectLayer>(child_bounds, Clip::kHardEdge);
153 parent->Add(layer);
154
155 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
156 parent->Preroll(preroll_context());
157 EXPECT_EQ(layer->paint_bounds(), child_bounds);
158 EXPECT_EQ(layer->child_paint_bounds(), child_bounds);
159 EXPECT_TRUE(layer->needs_painting(paint_context()));
160 EXPECT_EQ(mock_layer->parent_matrix(), initial_transform);
161
162 DlPaint filter_paint = DlPaint();
163 filter_paint.setBlendMode(DlBlendMode::kSrc);
164
165 parent->Paint(display_list_paint_context());
166 DisplayListBuilder expected_builder;
167 /* (ClipRect)parent::Paint */ {
168 expected_builder.Save();
169 {
170 expected_builder.ClipRect(child_bounds, DlClipOp::kIntersect, false);
171 /* (BackdropFilter)layer::Paint */ {
172 expected_builder.Save();
173 {
174 DlPaint save_paint = DlPaint().setBlendMode(DlBlendMode::kSrc);
175 expected_builder.SaveLayer(child_bounds, &save_paint,
176 layer_filter.get());
177 {
178 /* mock_layer::Paint */ {
179 expected_builder.DrawPath(child_path, child_paint);
180 }
181 }
182 expected_builder.Restore();
183 }
184 expected_builder.Restore();
185 }
186 }
187 expected_builder.Restore();
188 }
189 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
190}
191
192TEST_F(BackdropFilterLayerTest, MultipleChildren) {
193 const DlMatrix initial_transform = DlMatrix::MakeTranslation({0.5f, 1.0f});
194 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f);
195 const DlPath child_path1 = DlPath::MakeRect(child_bounds);
196 const DlPath child_path2 = DlPath::MakeRect(child_bounds.Shift(3.0f, 0.0f));
197 const DlPaint child_paint1 = DlPaint(DlColor::kYellow());
198 const DlPaint child_paint2 = DlPaint(DlColor::kCyan());
199 const DlRect children_bounds =
200 child_path1.GetBounds().Union(child_path2.GetBounds());
201 auto layer_filter = DlImageFilter::MakeBlur(2.5, 3.2, DlTileMode::kClamp);
202 auto mock_layer1 = std::make_shared<MockLayer>(child_path1, child_paint1);
203 auto mock_layer2 = std::make_shared<MockLayer>(child_path2, child_paint2);
204 auto layer = std::make_shared<BackdropFilterLayer>(layer_filter,
205 DlBlendMode::kSrcOver);
206 layer->Add(mock_layer1);
207 layer->Add(mock_layer2);
208 auto parent =
209 std::make_shared<ClipRectLayer>(children_bounds, Clip::kHardEdge);
210 parent->Add(layer);
211
212 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
213 parent->Preroll(preroll_context());
214 EXPECT_EQ(mock_layer1->paint_bounds(), child_path1.GetBounds());
215 EXPECT_EQ(mock_layer2->paint_bounds(), child_path2.GetBounds());
216 EXPECT_EQ(layer->paint_bounds(), children_bounds);
217 EXPECT_EQ(layer->child_paint_bounds(), children_bounds);
218 EXPECT_TRUE(mock_layer1->needs_painting(paint_context()));
219 EXPECT_TRUE(mock_layer2->needs_painting(paint_context()));
220 EXPECT_TRUE(layer->needs_painting(paint_context()));
221 EXPECT_EQ(mock_layer1->parent_matrix(), initial_transform);
222 EXPECT_EQ(mock_layer2->parent_matrix(), initial_transform);
223
224 parent->Paint(display_list_paint_context());
225 DisplayListBuilder expected_builder;
226 /* (ClipRect)parent::Paint */ {
227 expected_builder.Save();
228 {
229 expected_builder.ClipRect(children_bounds, DlClipOp::kIntersect, false);
230 /* (BackdropFilter)layer::Paint */ {
231 expected_builder.Save();
232 {
233 expected_builder.SaveLayer(children_bounds, nullptr,
234 layer_filter.get());
235 {
236 /* mock_layer1::Paint */ {
237 expected_builder.DrawPath(child_path1, child_paint1);
238 }
239 /* mock_layer2::Paint */ {
240 expected_builder.DrawPath(child_path2, child_paint2);
241 }
242 }
243 expected_builder.Restore();
244 }
245 expected_builder.Restore();
246 }
247 }
248 expected_builder.Restore();
249 }
250 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
251}
252
254 const DlMatrix initial_transform = DlMatrix::MakeTranslation({0.5f, 1.0f});
255 const DlRect child_bounds = DlRect::MakeLTRB(5.0f, 6.0f, 2.5f, 3.5f);
256 const DlPath child_path1 = DlPath::MakeRect(child_bounds);
257 const DlPath child_path2 = DlPath::MakeRect(child_bounds.Shift(3.0f, 0.0f));
258 const DlPaint child_paint1 = DlPaint(DlColor::kYellow());
259 const DlPaint child_paint2 = DlPaint(DlColor::kCyan());
260 const DlRect children_bounds =
261 child_path1.GetBounds().Union(child_path2.GetBounds());
262 auto layer_filter1 = DlImageFilter::MakeBlur(2.5, 3.2, DlTileMode::kClamp);
263 auto layer_filter2 = DlImageFilter::MakeBlur(2.7, 3.1, DlTileMode::kDecal);
264 auto mock_layer1 = std::make_shared<MockLayer>(child_path1, child_paint1);
265 auto mock_layer2 = std::make_shared<MockLayer>(child_path2, child_paint2);
266 auto layer1 = std::make_shared<BackdropFilterLayer>(layer_filter1,
267 DlBlendMode::kSrcOver);
268 auto layer2 = std::make_shared<BackdropFilterLayer>(layer_filter2,
269 DlBlendMode::kSrcOver);
270 layer2->Add(mock_layer2);
271 layer1->Add(mock_layer1);
272 layer1->Add(layer2);
273 auto parent =
274 std::make_shared<ClipRectLayer>(children_bounds, Clip::kHardEdge);
275 parent->Add(layer1);
276
277 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
278 parent->Preroll(preroll_context());
279
280 EXPECT_EQ(mock_layer1->paint_bounds(), child_path1.GetBounds());
281 EXPECT_EQ(mock_layer2->paint_bounds(), child_path2.GetBounds());
282 EXPECT_EQ(layer1->paint_bounds(), children_bounds);
283 EXPECT_EQ(layer2->paint_bounds(), children_bounds);
284 EXPECT_TRUE(mock_layer1->needs_painting(paint_context()));
285 EXPECT_TRUE(mock_layer2->needs_painting(paint_context()));
286 EXPECT_TRUE(layer1->needs_painting(paint_context()));
287 EXPECT_TRUE(layer2->needs_painting(paint_context()));
288 EXPECT_EQ(mock_layer1->parent_matrix(), initial_transform);
289 EXPECT_EQ(mock_layer2->parent_matrix(), initial_transform);
290
291 parent->Paint(display_list_paint_context());
292 DisplayListBuilder expected_builder;
293 /* (ClipRect)parent::Paint */ {
294 expected_builder.Save();
295 {
296 expected_builder.ClipRect(children_bounds, DlClipOp::kIntersect, false);
297 /* (BackdropFilter)layer1::Paint */ {
298 expected_builder.Save();
299 {
300 expected_builder.SaveLayer(children_bounds, nullptr,
301 layer_filter1.get());
302 {
303 /* mock_layer1::Paint */ {
304 expected_builder.DrawPath(child_path1, child_paint1);
305 }
306 /* (BackdropFilter)layer2::Paint */ {
307 expected_builder.Save();
308 {
309 expected_builder.SaveLayer(children_bounds, nullptr,
310 layer_filter2.get());
311 {
312 /* mock_layer2::Paint */ {
313 expected_builder.DrawPath(child_path2, child_paint2);
314 }
315 }
316 expected_builder.Restore();
317 }
318 expected_builder.Restore();
319 }
320 }
321 expected_builder.Restore();
322 }
323 expected_builder.Restore();
324 }
325 }
326 expected_builder.Restore();
327 }
328 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
329}
330
332 std::shared_ptr<DlImageFilter> no_filter;
333 auto layer_filter = DlImageFilter::MakeBlur(5, 5, DlTileMode::kClamp);
334 auto initial_transform = DlMatrix();
335
336 // BDF with filter always reads from surface
337 auto layer1 = std::make_shared<BackdropFilterLayer>(layer_filter,
338 DlBlendMode::kSrcOver);
339 preroll_context()->surface_needs_readback = false;
340 preroll_context()->state_stack.set_preroll_delegate(initial_transform);
341 layer1->Preroll(preroll_context());
342 EXPECT_TRUE(preroll_context()->surface_needs_readback);
343
344 // BDF with no filter does not read from surface itself
345 auto layer2 =
346 std::make_shared<BackdropFilterLayer>(no_filter, DlBlendMode::kSrcOver);
347 preroll_context()->surface_needs_readback = false;
348 layer2->Preroll(preroll_context());
349 EXPECT_FALSE(preroll_context()->surface_needs_readback);
350
351 // BDF with no filter does not block prior readback value
352 preroll_context()->surface_needs_readback = true;
353 layer2->Preroll(preroll_context());
354 EXPECT_TRUE(preroll_context()->surface_needs_readback);
355
356 // BDF with no filter blocks child with readback
357 auto mock_layer = std::make_shared<MockLayer>(DlPath(), DlPaint());
358 mock_layer->set_fake_reads_surface(true);
359 layer2->Add(mock_layer);
360 preroll_context()->surface_needs_readback = false;
361 layer2->Preroll(preroll_context());
362 EXPECT_FALSE(preroll_context()->surface_needs_readback);
363}
364
365TEST_F(BackdropFilterLayerTest, OpacityInheritance) {
366 auto backdrop_filter = DlImageFilter::MakeBlur(5, 5, DlTileMode::kClamp);
367 const DlPath mock_path = DlPath::MakeRectLTRB(0, 0, 10, 10);
368 const DlPaint mock_paint = DlPaint(DlColor::kRed());
369 const DlRect clip_rect = DlRect::MakeLTRB(0, 0, 100, 100);
370
371 auto clip = std::make_shared<ClipRectLayer>(clip_rect, Clip::kHardEdge);
372 auto parent = std::make_shared<OpacityLayer>(128, DlPoint());
373 auto layer = std::make_shared<BackdropFilterLayer>(backdrop_filter,
374 DlBlendMode::kSrcOver);
375 auto child = std::make_shared<MockLayer>(mock_path, mock_paint);
376 layer->Add(child);
377 parent->Add(layer);
378 clip->Add(parent);
379
380 clip->Preroll(preroll_context());
381
382 clip->Paint(display_list_paint_context());
383
384 DisplayListBuilder expected_builder;
385 /* ClipRectLayer::Paint */ {
386 expected_builder.Save();
387 {
388 expected_builder.ClipRect(clip_rect, DlClipOp::kIntersect, false);
389 /* OpacityLayer::Paint */ {
390 // NOP - it hands opacity down to BackdropFilterLayer
391 /* BackdropFilterLayer::Paint */ {
392 DlPaint save_paint;
393 save_paint.setAlpha(128);
394 expected_builder.SaveLayer(clip_rect, &save_paint,
395 backdrop_filter.get());
396 {
397 /* MockLayer::Paint */ {
398 DlPaint child_paint;
399 child_paint.setColor(DlColor::kRed());
400 expected_builder.DrawPath(mock_path, child_paint);
401 }
402 }
403 expected_builder.Restore();
404 }
405 }
406 }
407 expected_builder.Restore();
408 }
409 EXPECT_TRUE(DisplayListsEQ_Verbose(display_list(), expected_builder.Build()));
410}
411
413
415 auto filter = DlImageFilter::MakeBlur(10, 10, DlTileMode::kClamp);
416
417 {
418 // tests later assume 30px readback area, fail early if that's not the case
419 DlIRect readback;
420 EXPECT_EQ(filter->get_input_device_bounds(DlIRect::MakeWH(10, 10),
421 DlMatrix(), readback),
422 &readback);
423 EXPECT_EQ(readback, DlIRect::MakeLTRB(-30, -30, 40, 40));
424 }
425
426 MockLayerTree l1(DlISize(100, 100));
427 l1.root()->Add(
428 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver));
429
430 // no clip, effect over entire surface
431 auto damage = DiffLayerTree(l1, MockLayerTree(DlISize(100, 100)));
432 EXPECT_EQ(damage.frame_damage, DlIRect::MakeWH(100, 100));
433
434 MockLayerTree l2(DlISize(100, 100));
435
436 auto clip = std::make_shared<ClipRectLayer>(DlRect::MakeLTRB(20, 20, 60, 60),
438 clip->Add(
439 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver));
440 l2.root()->Add(clip);
441 damage = DiffLayerTree(l2, MockLayerTree(DlISize(100, 100)));
442
443 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(0, 0, 90, 90));
444
445 MockLayerTree l3;
446 auto scale =
447 std::make_shared<TransformLayer>(DlMatrix::MakeScale({2.0, 2.0, 1.0f}));
448 scale->Add(clip);
449 l3.root()->Add(scale);
450
451 damage = DiffLayerTree(l3, MockLayerTree());
452 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(0, 0, 180, 180));
453
454 MockLayerTree l4;
455 l4.root()->Add(scale);
456
457 // path just outside of readback region, doesn't affect blur
458 auto path1 = DlPath::MakeRectLTRB(180, 180, 190, 190);
459 l4.root()->Add(std::make_shared<MockLayer>(path1));
460 damage = DiffLayerTree(l4, l3);
461 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(180, 180, 190, 190));
462
463 MockLayerTree l5;
464 l5.root()->Add(scale);
465
466 // path just inside of readback region, must trigger backdrop repaint
467 auto path2 = DlPath::MakeRectLTRB(179, 179, 189, 189);
468 l5.root()->Add(std::make_shared<MockLayer>(path2));
469 damage = DiffLayerTree(l5, l4);
470 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(0, 0, 190, 190));
471}
472
473TEST_F(BackdropLayerDiffTest, ReadbackOutsideOfPaintArea) {
476
477 MockLayerTree l1(DlISize(100, 100));
478
479 auto clip = std::make_shared<ClipRectLayer>(DlRect::MakeLTRB(60, 60, 80, 80),
481 clip->Add(
482 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver));
483 l1.root()->Add(clip);
484 auto damage = DiffLayerTree(l1, MockLayerTree(DlISize(100, 100)));
485
486 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(60 - 50, 60 - 50, 80, 80));
487
488 MockLayerTree l2(DlISize(100, 100));
489 // path inside readback area must trigger whole readback repaint + filter
490 // repaint.
491 auto path2 = DlPath::MakeRectXYWH(60 - 50, 60 - 50, 10, 10);
492 l2.root()->Add(clip);
493 l2.root()->Add(std::make_shared<MockLayer>(path2));
494 damage = DiffLayerTree(l2, l1);
495 EXPECT_EQ(damage.frame_damage, DlIRect::MakeLTRB(60 - 50, 60 - 50, 80, 80));
496}
497
498TEST_F(BackdropLayerDiffTest, BackdropLayerInvalidTransform) {
499 auto filter = DlImageFilter::MakeBlur(10, 10, DlTileMode::kClamp);
500
501 {
502 // tests later assume 30px readback area, fail early if that's not the case
503 DlIRect readback;
504 EXPECT_EQ(filter->get_input_device_bounds(DlIRect::MakeWH(10, 10),
505 DlMatrix(), readback),
506 &readback);
507 EXPECT_EQ(readback, DlIRect::MakeLTRB(-30, -30, 40, 40));
508 }
509
510 MockLayerTree l1(DlISize(100, 100));
511 // clang-format off
513 1, 0, 0, 0.1f,
514 0, 1, 0, 0.1f,
515 0, 0, 1, 0,
516 0, 0, 0, 1
517 );
518 // clang-format on
519
520 auto transform_layer = std::make_shared<TransformLayer>(transform);
521 l1.root()->Add(transform_layer);
522 transform_layer->Add(
523 std::make_shared<BackdropFilterLayer>(filter, DlBlendMode::kSrcOver));
524
525 auto damage = DiffLayerTree(l1, MockLayerTree(DlISize(100, 100)));
526 EXPECT_EQ(damage.frame_damage, DlIRect::MakeWH(100, 100));
527}
528
529} // namespace testing
530} // namespace flutter
virtual void Add(std::shared_ptr< Layer > layer)
void ClipRect(const DlRect &rect, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false) override
void SaveLayer(const std::optional< DlRect > &bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt) override
sk_sp< DisplayList > Build()
Definition dl_builder.cc:66
void DrawPath(const DlPath &path, const DlPaint &paint) override
static std::shared_ptr< DlImageFilter > MakeBlur(DlScalar sigma_x, DlScalar sigma_y, DlTileMode tile_mode)
static std::shared_ptr< DlImageFilter > MakeMatrix(const DlMatrix &matrix, DlImageSampling sampling)
DlPaint & setColor(DlColor color)
Definition dl_paint.h:70
DlPaint & setAlpha(uint8_t alpha)
Definition dl_paint.h:76
DlPaint & setBlendMode(DlBlendMode mode)
Definition dl_paint.h:85
static DlPath MakeRectLTRB(DlScalar left, DlScalar top, DlScalar right, DlScalar bottom)
Definition dl_path.cc:43
static DlPath MakeRectXYWH(DlScalar x, DlScalar y, DlScalar width, DlScalar height)
Definition dl_path.cc:50
static DlPath MakeRect(const DlRect &rect)
Definition dl_path.cc:39
DlRect GetBounds() const override
Definition dl_path.cc:245
TEST_F(DisplayListTest, Defaults)
LayerTestBase<::testing::Test > LayerTest
Definition layer_test.h:177
bool DisplayListsEQ_Verbose(const DisplayList *a, const DisplayList *b)
@ kHardEdge
Definition layer.h:43
impeller::Matrix DlMatrix
impeller::Rect DlRect
impeller::ISize32 DlISize
impeller::Point DlPoint
static constexpr DlColor kYellow()
Definition dl_color.h:76
static constexpr DlColor kRed()
Definition dl_color.h:71
static constexpr DlColor kCyan()
Definition dl_color.h:74
A 4x4 matrix using column-major storage.
Definition matrix.h:37
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition matrix.h:95
static constexpr Matrix MakeScale(const Vector3 &s)
Definition matrix.h:104
static constexpr TRect MakeWH(Type width, Type height)
Definition rect.h:140
constexpr TRect Union(const TRect &o) const
Definition rect.h:513
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition rect.h:129