Flutter Engine
The Flutter Engine
layer_state_stack_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
5#include "gtest/gtest.h"
6
7#include "flutter/display_list/effects/dl_color_filter.h"
8#include "flutter/display_list/effects/dl_image_filter.h"
9#include "flutter/flow/layers/layer.h"
10#include "flutter/flow/layers/layer_state_stack.h"
11#include "flutter/testing/display_list_testing.h"
12
13namespace flutter {
14namespace testing {
15
16#ifndef NDEBUG
17TEST(LayerStateStack, AccessorsDieWithoutDelegate) {
18 LayerStateStack state_stack;
19
20 EXPECT_DEATH_IF_SUPPORTED(state_stack.device_cull_rect(),
21 "LayerStateStack state queried without a delegate");
22 EXPECT_DEATH_IF_SUPPORTED(state_stack.local_cull_rect(),
23 "LayerStateStack state queried without a delegate");
24 EXPECT_DEATH_IF_SUPPORTED(state_stack.transform_3x3(),
25 "LayerStateStack state queried without a delegate");
26 EXPECT_DEATH_IF_SUPPORTED(state_stack.transform_4x4(),
27 "LayerStateStack state queried without a delegate");
28 EXPECT_DEATH_IF_SUPPORTED(state_stack.content_culled({}),
29 "LayerStateStack state queried without a delegate");
30 {
31 // state_stack.set_preroll_delegate(kGiantRect, SkMatrix::I());
32 auto mutator = state_stack.save();
33 mutator.applyOpacity({}, 0.5);
34 state_stack.clear_delegate();
35 auto restore = state_stack.applyState({}, 0);
36 }
37}
38#endif
39
41 LayerStateStack state_stack;
42
43 ASSERT_EQ(state_stack.canvas_delegate(), nullptr);
44 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
45 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
46 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
47 ASSERT_EQ(state_stack.outstanding_bounds(), SkRect());
48
50 ASSERT_EQ(state_stack.device_cull_rect(), kGiantRect);
51 ASSERT_EQ(state_stack.local_cull_rect(), kGiantRect);
52 ASSERT_EQ(state_stack.transform_3x3(), SkMatrix::I());
53 ASSERT_EQ(state_stack.transform_4x4(), SkM44());
54
55 DlPaint dl_paint;
56 state_stack.fill(dl_paint);
57 ASSERT_EQ(dl_paint, DlPaint());
58}
59
60TEST(LayerStateStack, SingularDelegate) {
61 LayerStateStack state_stack;
62 ASSERT_EQ(state_stack.canvas_delegate(), nullptr);
63
64 // Two different DlCanvas implementators
66 DisplayListBuilder builder2;
67 DlCanvas& canvas = builder2;
68
69 // no delegate -> builder delegate
70 state_stack.set_delegate(&builder);
71 ASSERT_EQ(state_stack.canvas_delegate(), &builder);
72
73 // builder delegate -> DlCanvas delegate
74 state_stack.set_delegate(&canvas);
75 ASSERT_EQ(state_stack.canvas_delegate(), &canvas);
76
77 // DlCanvas delegate -> builder delegate
78 state_stack.set_delegate(&builder);
79 ASSERT_EQ(state_stack.canvas_delegate(), &builder);
80
81 // builder delegate -> no delegate
82 state_stack.clear_delegate();
83 ASSERT_EQ(state_stack.canvas_delegate(), nullptr);
84
85 // DlCanvas delegate -> no delegate
86 state_stack.set_delegate(&canvas);
87 state_stack.clear_delegate();
88 ASSERT_EQ(state_stack.canvas_delegate(), nullptr);
89}
90
91TEST(LayerStateStack, OldDelegateIsRolledBack) {
92 LayerStateStack state_stack;
94 DisplayListBuilder builder2;
95 DlCanvas& canvas = builder2;
96
97 ASSERT_TRUE(builder.GetTransform().isIdentity());
98 ASSERT_TRUE(canvas.GetTransform().isIdentity());
99
100 state_stack.set_delegate(&builder);
101
102 ASSERT_TRUE(builder.GetTransform().isIdentity());
103 ASSERT_TRUE(canvas.GetTransform().isIdentity());
104
105 auto mutator = state_stack.save();
106 mutator.translate({10, 10});
107
108 ASSERT_EQ(builder.GetTransform(), SkMatrix::Translate(10, 10));
109 ASSERT_TRUE(canvas.GetTransform().isIdentity());
110
111 state_stack.set_delegate(&canvas);
112
113 ASSERT_TRUE(builder.GetTransform().isIdentity());
114 ASSERT_EQ(canvas.GetTransform(), SkMatrix::Translate(10, 10));
115
116 state_stack.set_preroll_delegate(SkRect::MakeWH(100, 100));
117
118 ASSERT_TRUE(builder.GetTransform().isIdentity());
119 ASSERT_TRUE(canvas.GetTransform().isIdentity());
120
121 state_stack.set_delegate(&builder);
122 state_stack.clear_delegate();
123
124 ASSERT_TRUE(builder.GetTransform().isIdentity());
125 ASSERT_TRUE(canvas.GetTransform().isIdentity());
126
127 state_stack.set_delegate(&canvas);
128 state_stack.clear_delegate();
129
130 ASSERT_TRUE(builder.GetTransform().isIdentity());
131 ASSERT_TRUE(canvas.GetTransform().isIdentity());
132}
133
135 SkRect rect = {10, 10, 20, 20};
136
137 LayerStateStack state_stack;
138 state_stack.set_preroll_delegate(SkRect::MakeLTRB(0, 0, 50, 50));
139 {
140 auto mutator = state_stack.save();
141 mutator.applyOpacity(rect, 0.5f);
142
143 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
144 ASSERT_EQ(state_stack.outstanding_bounds(), rect);
145
146 // Check nested opacities multiply with each other
147 {
148 auto mutator2 = state_stack.save();
149 mutator.applyOpacity(rect, 0.5f);
150
151 ASSERT_EQ(state_stack.outstanding_opacity(), 0.25f);
152 ASSERT_EQ(state_stack.outstanding_bounds(), rect);
153
154 // Verify output with applyState that does not accept opacity
155 {
157 state_stack.set_delegate(&builder);
158 {
159 auto restore = state_stack.applyState(rect, 0);
160 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
161 ASSERT_EQ(state_stack.outstanding_bounds(), SkRect());
162
164 state_stack.fill(paint);
165 builder.DrawRect(rect, paint);
166 }
167 state_stack.clear_delegate();
168
169 DisplayListBuilder expected;
170 DlPaint save_paint =
171 DlPaint().setOpacity(state_stack.outstanding_opacity());
172 expected.SaveLayer(&rect, &save_paint);
173 expected.DrawRect(rect, DlPaint());
174 expected.Restore();
175 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
176 }
177
178 // Verify output with applyState that accepts opacity
179 {
181 state_stack.set_delegate(&builder);
182 {
183 auto restore = state_stack.applyState(
185 ASSERT_EQ(state_stack.outstanding_opacity(), 0.25f);
186 ASSERT_EQ(state_stack.outstanding_bounds(), rect);
187
189 state_stack.fill(paint);
190 builder.DrawRect(rect, paint);
191 }
192 state_stack.clear_delegate();
193
194 DisplayListBuilder expected;
195 expected.DrawRect(rect, DlPaint().setOpacity(0.25f));
196 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
197 }
198 }
199
200 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
201 ASSERT_EQ(state_stack.outstanding_bounds(), rect);
202 }
203
204 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
205 ASSERT_EQ(state_stack.outstanding_bounds(), SkRect());
206}
207
209 SkRect rect = {10, 10, 20, 20};
210 std::shared_ptr<DlBlendColorFilter> outer_filter =
211 std::make_shared<DlBlendColorFilter>(DlColor::kYellow(),
213 std::shared_ptr<DlBlendColorFilter> inner_filter =
214 std::make_shared<DlBlendColorFilter>(DlColor::kRed(),
216
217 LayerStateStack state_stack;
218 state_stack.set_preroll_delegate(SkRect::MakeLTRB(0, 0, 50, 50));
219 {
220 auto mutator = state_stack.save();
221 mutator.applyColorFilter(rect, outer_filter);
222
223 ASSERT_EQ(state_stack.outstanding_color_filter(), outer_filter);
224
225 // Check nested color filters result in nested saveLayers
226 {
227 auto mutator2 = state_stack.save();
228 mutator.applyColorFilter(rect, inner_filter);
229
230 ASSERT_EQ(state_stack.outstanding_color_filter(), inner_filter);
231
232 // Verify output with applyState that does not accept color filters
233 {
235 state_stack.set_delegate(&builder);
236 {
237 auto restore = state_stack.applyState(rect, 0);
238 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
239
241 state_stack.fill(paint);
242 builder.DrawRect(rect, paint);
243 }
244 state_stack.clear_delegate();
245
246 DisplayListBuilder expected;
247 DlPaint outer_save_paint = DlPaint().setColorFilter(outer_filter);
248 DlPaint inner_save_paint = DlPaint().setColorFilter(inner_filter);
249 expected.SaveLayer(&rect, &outer_save_paint);
250 expected.SaveLayer(&rect, &inner_save_paint);
251 expected.DrawRect(rect, DlPaint());
252 expected.Restore();
253 expected.Restore();
254 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
255 }
256
257 // Verify output with applyState that accepts color filters
258 {
259 SkRect rect = {10, 10, 20, 20};
261 state_stack.set_delegate(&builder);
262 {
263 auto restore = state_stack.applyState(
265 ASSERT_EQ(state_stack.outstanding_color_filter(), inner_filter);
266
268 state_stack.fill(paint);
269 builder.DrawRect(rect, paint);
270 }
271 state_stack.clear_delegate();
272
273 DisplayListBuilder expected;
274 DlPaint save_paint = DlPaint().setColorFilter(outer_filter);
275 DlPaint draw_paint = DlPaint().setColorFilter(inner_filter);
276 expected.SaveLayer(&rect, &save_paint);
277 expected.DrawRect(rect, draw_paint);
278 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
279 }
280 }
281
282 ASSERT_EQ(state_stack.outstanding_color_filter(), outer_filter);
283 }
284
285 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
286}
287
289 SkRect rect = {10, 10, 20, 20};
290 std::shared_ptr<DlBlurImageFilter> outer_filter =
291 std::make_shared<DlBlurImageFilter>(2.0f, 2.0f, DlTileMode::kClamp);
292 std::shared_ptr<DlBlurImageFilter> inner_filter =
293 std::make_shared<DlBlurImageFilter>(3.0f, 3.0f, DlTileMode::kClamp);
294 SkRect inner_src_rect = rect;
295 SkRect outer_src_rect;
296 ASSERT_EQ(inner_filter->map_local_bounds(rect, outer_src_rect),
297 &outer_src_rect);
298
299 LayerStateStack state_stack;
300 state_stack.set_preroll_delegate(SkRect::MakeLTRB(0, 0, 50, 50));
301 {
302 auto mutator = state_stack.save();
303 mutator.applyImageFilter(outer_src_rect, outer_filter);
304
305 ASSERT_EQ(state_stack.outstanding_image_filter(), outer_filter);
306
307 // Check nested color filters result in nested saveLayers
308 {
309 auto mutator2 = state_stack.save();
310 mutator.applyImageFilter(rect, inner_filter);
311
312 ASSERT_EQ(state_stack.outstanding_image_filter(), inner_filter);
313
314 // Verify output with applyState that does not accept color filters
315 {
317 state_stack.set_delegate(&builder);
318 {
319 auto restore = state_stack.applyState(rect, 0);
320 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
321
323 state_stack.fill(paint);
324 builder.DrawRect(rect, paint);
325 }
326 state_stack.clear_delegate();
327
328 DisplayListBuilder expected;
329 DlPaint outer_save_paint = DlPaint().setImageFilter(outer_filter);
330 DlPaint inner_save_paint = DlPaint().setImageFilter(inner_filter);
331 expected.SaveLayer(&outer_src_rect, &outer_save_paint);
332 expected.SaveLayer(&inner_src_rect, &inner_save_paint);
333 expected.DrawRect(rect, DlPaint());
334 expected.Restore();
335 expected.Restore();
336 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
337 }
338
339 // Verify output with applyState that accepts color filters
340 {
341 SkRect rect = {10, 10, 20, 20};
343 state_stack.set_delegate(&builder);
344 {
345 auto restore = state_stack.applyState(
347 ASSERT_EQ(state_stack.outstanding_image_filter(), inner_filter);
348
350 state_stack.fill(paint);
351 builder.DrawRect(rect, paint);
352 }
353 state_stack.clear_delegate();
354
355 DisplayListBuilder expected;
356 DlPaint save_paint = DlPaint().setImageFilter(outer_filter);
357 DlPaint draw_paint = DlPaint().setImageFilter(inner_filter);
358 expected.SaveLayer(&outer_src_rect, &save_paint);
359 expected.DrawRect(rect, draw_paint);
360 ASSERT_TRUE(DisplayListsEQ_Verbose(builder.Build(), expected.Build()));
361 }
362 }
363
364 ASSERT_EQ(state_stack.outstanding_image_filter(), outer_filter);
365 }
366
367 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
368}
369
370TEST(LayerStateStack, OpacityAndColorFilterInteraction) {
371 SkRect rect = {10, 10, 20, 20};
372 std::shared_ptr<DlBlendColorFilter> color_filter =
373 std::make_shared<DlBlendColorFilter>(DlColor::kYellow(),
375
377 LayerStateStack state_stack;
378 state_stack.set_delegate(&builder);
379 ASSERT_EQ(builder.GetSaveCount(), 1);
380
381 {
382 auto mutator1 = state_stack.save();
383 ASSERT_EQ(builder.GetSaveCount(), 1);
384 mutator1.applyOpacity(rect, 0.5f);
385 ASSERT_EQ(builder.GetSaveCount(), 1);
386
387 {
388 auto mutator2 = state_stack.save();
389 ASSERT_EQ(builder.GetSaveCount(), 1);
390 mutator2.applyColorFilter(rect, color_filter);
391
392 // The opacity will have been resolved by a saveLayer
393 ASSERT_EQ(builder.GetSaveCount(), 2);
394 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
395 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
396 }
397 ASSERT_EQ(builder.GetSaveCount(), 1);
398 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
399 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
400 }
401 ASSERT_EQ(builder.GetSaveCount(), 1);
402 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
403 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
404
405 {
406 auto mutator1 = state_stack.save();
407 ASSERT_EQ(builder.GetSaveCount(), 1);
408 mutator1.applyColorFilter(rect, color_filter);
409 ASSERT_EQ(builder.GetSaveCount(), 1);
410
411 {
412 auto mutator2 = state_stack.save();
413 ASSERT_EQ(builder.GetSaveCount(), 1);
414 mutator2.applyOpacity(rect, 0.5f);
415
416 // color filter applied to opacity can be applied together
417 ASSERT_EQ(builder.GetSaveCount(), 1);
418 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
419 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
420 }
421 ASSERT_EQ(builder.GetSaveCount(), 1);
422 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
423 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
424 }
425 ASSERT_EQ(builder.GetSaveCount(), 1);
426 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
427 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
428}
429
430TEST(LayerStateStack, OpacityAndImageFilterInteraction) {
431 SkRect rect = {10, 10, 20, 20};
432 std::shared_ptr<DlBlurImageFilter> image_filter =
433 std::make_shared<DlBlurImageFilter>(2.0f, 2.0f, DlTileMode::kClamp);
434
436 LayerStateStack state_stack;
437 state_stack.set_delegate(&builder);
438 ASSERT_EQ(builder.GetSaveCount(), 1);
439
440 {
441 auto mutator1 = state_stack.save();
442 ASSERT_EQ(builder.GetSaveCount(), 1);
443 mutator1.applyOpacity(rect, 0.5f);
444 ASSERT_EQ(builder.GetSaveCount(), 1);
445
446 {
447 auto mutator2 = state_stack.save();
448 ASSERT_EQ(builder.GetSaveCount(), 1);
449 mutator2.applyImageFilter(rect, image_filter);
450
451 // opacity applied to image filter can be applied together
452 ASSERT_EQ(builder.GetSaveCount(), 1);
453 ASSERT_EQ(state_stack.outstanding_image_filter(), image_filter);
454 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
455 }
456 ASSERT_EQ(builder.GetSaveCount(), 1);
457 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
458 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
459 }
460 ASSERT_EQ(builder.GetSaveCount(), 1);
461 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
462 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
463
464 {
465 auto mutator1 = state_stack.save();
466 ASSERT_EQ(builder.GetSaveCount(), 1);
467 mutator1.applyImageFilter(rect, image_filter);
468 ASSERT_EQ(builder.GetSaveCount(), 1);
469
470 {
471 auto mutator2 = state_stack.save();
472 ASSERT_EQ(builder.GetSaveCount(), 1);
473 mutator2.applyOpacity(rect, 0.5f);
474
475 // The image filter will have been resolved by a saveLayer
476 ASSERT_EQ(builder.GetSaveCount(), 2);
477 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
478 ASSERT_EQ(state_stack.outstanding_opacity(), 0.5f);
479 }
480 ASSERT_EQ(builder.GetSaveCount(), 1);
481 ASSERT_EQ(state_stack.outstanding_image_filter(), image_filter);
482 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
483 }
484 ASSERT_EQ(builder.GetSaveCount(), 1);
485 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
486 ASSERT_EQ(state_stack.outstanding_opacity(), SK_Scalar1);
487}
488
489TEST(LayerStateStack, ColorFilterAndImageFilterInteraction) {
490 SkRect rect = {10, 10, 20, 20};
491 std::shared_ptr<DlBlendColorFilter> color_filter =
492 std::make_shared<DlBlendColorFilter>(DlColor::kYellow(),
494 std::shared_ptr<DlBlurImageFilter> image_filter =
495 std::make_shared<DlBlurImageFilter>(2.0f, 2.0f, DlTileMode::kClamp);
496
498 LayerStateStack state_stack;
499 state_stack.set_delegate(&builder);
500 ASSERT_EQ(builder.GetSaveCount(), 1);
501
502 {
503 auto mutator1 = state_stack.save();
504 ASSERT_EQ(builder.GetSaveCount(), 1);
505 mutator1.applyColorFilter(rect, color_filter);
506 ASSERT_EQ(builder.GetSaveCount(), 1);
507
508 {
509 auto mutator2 = state_stack.save();
510 ASSERT_EQ(builder.GetSaveCount(), 1);
511 mutator2.applyImageFilter(rect, image_filter);
512
513 // color filter applied to image filter can be applied together
514 ASSERT_EQ(builder.GetSaveCount(), 1);
515 ASSERT_EQ(state_stack.outstanding_image_filter(), image_filter);
516 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
517 }
518 ASSERT_EQ(builder.GetSaveCount(), 1);
519 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
520 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
521 }
522 ASSERT_EQ(builder.GetSaveCount(), 1);
523 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
524 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
525
526 {
527 auto mutator1 = state_stack.save();
528 ASSERT_EQ(builder.GetSaveCount(), 1);
529 mutator1.applyImageFilter(rect, image_filter);
530 ASSERT_EQ(builder.GetSaveCount(), 1);
531
532 {
533 auto mutator2 = state_stack.save();
534 ASSERT_EQ(builder.GetSaveCount(), 1);
535 mutator2.applyColorFilter(rect, color_filter);
536
537 // The image filter will have been resolved by a saveLayer
538 ASSERT_EQ(builder.GetSaveCount(), 2);
539 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
540 ASSERT_EQ(state_stack.outstanding_color_filter(), color_filter);
541 }
542 ASSERT_EQ(builder.GetSaveCount(), 1);
543 ASSERT_EQ(state_stack.outstanding_image_filter(), image_filter);
544 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
545 }
546 ASSERT_EQ(builder.GetSaveCount(), 1);
547 ASSERT_EQ(state_stack.outstanding_image_filter(), nullptr);
548 ASSERT_EQ(state_stack.outstanding_color_filter(), nullptr);
549}
550
551} // namespace testing
552} // namespace flutter
static sk_sp< SkImage > color_filter(const SkImage *image, SkColorFilter *colorFilter)
#define SK_Scalar1
Definition: SkScalar.h:18
Definition: SkM44.h:150
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.h:91
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
bool isIdentity() const
Definition: SkMatrix.h:223
void DrawRect(const SkRect &rect, const DlPaint &paint) override
Definition: dl_builder.cc:1116
void SaveLayer(const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr) override
Definition: dl_builder.cc:549
sk_sp< DisplayList > Build()
Definition: dl_builder.cc:67
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
virtual SkMatrix GetTransform() const =0
DlPaint & setColorFilter(const std::shared_ptr< const DlColorFilter > &filter)
Definition: dl_paint.h:144
DlPaint & setImageFilter(const std::shared_ptr< const DlImageFilter > &filter)
Definition: dl_paint.h:157
DlPaint & setOpacity(SkScalar opacity)
Definition: dl_paint.h:78
void applyColorFilter(const SkRect &bounds, const std::shared_ptr< const DlColorFilter > &filter)
void translate(SkScalar tx, SkScalar ty)
void applyImageFilter(const SkRect &bounds, const std::shared_ptr< const DlImageFilter > &filter)
void applyOpacity(const SkRect &bounds, SkScalar opacity)
std::shared_ptr< const DlImageFilter > outstanding_image_filter() const
SkRect outstanding_bounds() const
SkMatrix transform_3x3() const
void fill(MutatorsStack *mutators)
AutoRestore applyState(const SkRect &bounds, int can_apply_flags)
void set_preroll_delegate(const SkRect &cull_rect, const SkMatrix &matrix)
SkScalar outstanding_opacity() const
static constexpr int kCallerCanApplyColorFilter
void set_delegate(DlCanvas *canvas)
bool content_culled(const SkRect &content_bounds) const
std::shared_ptr< const DlColorFilter > outstanding_color_filter() const
static constexpr int kCallerCanApplyImageFilter
static constexpr int kCallerCanApplyOpacity
const Paint & paint
Definition: color_source.cc:38
static void draw_paint(SkCanvas *canvas, const SkRect &r, sk_sp< SkImageFilter > imf)
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
bool DisplayListsEQ_Verbose(const DisplayList *a, const DisplayList *b)
TEST(DisplayListComplexity, EmptyDisplayList)
static constexpr SkRect kGiantRect
Definition: layer.h:50
@ kColorBurn
darken destination to reflect source
flutter::DlPaint DlPaint
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646
static constexpr DlColor kYellow()
Definition: dl_color.h:29
static constexpr DlColor kRed()
Definition: dl_color.h:24