5#include "flutter/flow/embedded_views.h"
6#include "gtest/gtest.h"
23 ASSERT_TRUE(
copy == stack);
35 ASSERT_TRUE(
copy != stack);
36 ASSERT_TRUE(
copy.is_empty());
38 auto iter = stack.
Bottom();
40 ASSERT_TRUE(iter->get()->GetRRect() ==
rrect);
43 ASSERT_TRUE(iter->get()->GetRect() ==
rect);
50 auto iter = stack.
Bottom();
52 ASSERT_TRUE(iter->get()->GetRect() ==
rect);
59 auto iter = stack.
Bottom();
61 ASSERT_TRUE(iter->get()->GetRRect() ==
rrect);
68 auto iter = stack.
Bottom();
69 ASSERT_TRUE(iter->get()->GetType() == flutter::MutatorType::kClipPath);
70 ASSERT_TRUE(iter->get()->GetPath() ==
path);
78 auto iter = stack.
Bottom();
79 ASSERT_TRUE(iter->get()->GetType() == MutatorType::kTransform);
80 ASSERT_TRUE(iter->get()->GetMatrix() ==
matrix);
87 auto iter = stack.
Bottom();
88 ASSERT_TRUE(iter->get()->GetType() == MutatorType::kOpacity);
89 ASSERT_TRUE(iter->get()->GetAlpha() == 240);
94 const int num_of_mutators = 10;
95 for (
int i = 0;
i < num_of_mutators;
i++) {
100 auto iter = stack.
Begin();
102 while (iter != stack.
End()) {
104 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilter().asBlur()->sigma_x(),
106 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().x(),
i);
107 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().x(),
i);
108 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().width(),
i);
109 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().height(),
i);
113 ASSERT_EQ(
i, num_of_mutators);
122 auto iter = stack.
Bottom();
123 ASSERT_TRUE(iter == stack.
Top());
135 auto iter = stack.
Bottom();
137 while (iter != stack.
Top()) {
141 ASSERT_TRUE(iter->get()->GetRRect() ==
rrect);
145 ASSERT_TRUE(iter->get()->GetRect() ==
rect);
148 ASSERT_TRUE(iter->get()->GetType() == MutatorType::kTransform);
149 ASSERT_TRUE(iter->get()->GetMatrix() ==
matrix);
183 int other_alpha = 240;
189 ASSERT_TRUE(stack == stack_other);
205 ASSERT_TRUE(mutator3.
GetType() == MutatorType::kClipPath);
211 ASSERT_TRUE(mutator4.
GetType() == MutatorType::kTransform);
216 ASSERT_TRUE(mutator5.
GetType() == MutatorType::kOpacity);
228 ASSERT_TRUE(mutator ==
copy);
233 ASSERT_TRUE(mutator2 == copy2);
238 ASSERT_TRUE(mutator3 == copy3);
244 ASSERT_TRUE(mutator4 == copy4);
249 ASSERT_TRUE(mutator5 == copy5);
254 ASSERT_TRUE(mutator6 == copy6);
262 ASSERT_TRUE(mutator == other_mutator);
267 ASSERT_TRUE(mutator2 == other_mutator2);
272 ASSERT_TRUE(mutator3 == other_mutator3);
277 ASSERT_TRUE(mutator4 == other_mutator4);
278 ASSERT_FALSE(mutator2 == mutator);
282 ASSERT_TRUE(mutator5 == other_mutator5);
288 ASSERT_TRUE(mutator6 == other_mutator6);
297 ASSERT_TRUE(not_equal_mutator != mutator);
303 ASSERT_TRUE(mutator2 != other_mutator2);
310 ASSERT_TRUE(mutator3 != other_mutator3);
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkRRect MakeEmpty()
const DlImageFilter & GetFilter() const
const SkMatrix & GetMatrix() const
const ImageFilterMutation & GetFilterMutation() const
const MutatorType & GetType() const
const SkPath & GetPath() const
const SkRRect & GetRRect() const
const SkRect & GetRect() const
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
TEST(DisplayListComplexity, EmptyDisplayList)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static constexpr SkRect MakeEmpty()
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)