8#include "gtest/gtest.h"
25 ASSERT_TRUE(copy == stack);
37 ASSERT_TRUE(copy != stack);
40 auto iter = stack.
Bottom();
42 ASSERT_TRUE(iter->get()->GetRRect() == rrect);
45 ASSERT_TRUE(iter->get()->GetRect() == rect);
52 auto iter = stack.
Bottom();
54 ASSERT_TRUE(iter->get()->GetRect() == rect);
61 auto iter = stack.
Bottom();
63 ASSERT_TRUE(iter->get()->GetRRect() == rrect);
70 auto iter = stack.
Bottom();
72 ASSERT_TRUE(iter->get()->GetRSE() == rse);
79 auto iter = stack.
Bottom();
81 ASSERT_TRUE(iter->get()->GetPath() ==
path);
88 auto iter = stack.
Bottom();
90 ASSERT_TRUE(iter->get()->GetMatrix() == matrix);
97 auto iter = stack.
Bottom();
99 ASSERT_TRUE(iter->get()->GetAlpha() == 240);
106 auto iter = stack.
Bottom();
108 ASSERT_TRUE(iter->get()->GetBackdropClipRect().rect == rect);
115 auto iter = stack.
Bottom();
117 ASSERT_TRUE(iter->get()->GetBackdropClipRRect().rrect == rrect);
124 auto iter = stack.
Bottom();
125 ASSERT_TRUE(iter->get()->GetType() ==
127 ASSERT_TRUE(iter->get()->GetBackdropClipRSuperellipse().rse == rse);
134 auto iter = stack.
Bottom();
136 ASSERT_TRUE(iter->get()->GetBackdropClipPath().path ==
path);
141 const int num_of_mutators = 10;
142 for (
int i = 0;
i < num_of_mutators;
i++) {
147 auto iter = stack.
Begin();
149 while (iter != stack.
End()) {
151 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilter().asBlur()->sigma_x(),
153 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().GetX(),
i);
154 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().GetY(),
i);
155 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().GetWidth(),
i);
156 ASSERT_EQ(iter->get()->GetFilterMutation().GetFilterRect().GetHeight(),
i);
160 ASSERT_EQ(
i, num_of_mutators);
168 auto iter = stack.
Bottom();
169 ASSERT_TRUE(iter == stack.
Top());
180 auto iter = stack.
Bottom();
182 while (iter != stack.
Top()) {
186 ASSERT_TRUE(iter->get()->GetRRect() == rrect);
190 ASSERT_TRUE(iter->get()->GetRect() == rect);
194 ASSERT_TRUE(iter->get()->GetMatrix() == matrix);
228 uint8_t other_alpha = 240;
233 ASSERT_TRUE(stack == stack_other);
240 ASSERT_TRUE(mutator.
GetRect() == rect);
245 ASSERT_TRUE(mutator2.
GetRRect() == rrect);
250 ASSERT_TRUE(mutator2se.
GetRSE() == rse);
260 ASSERT_TRUE(mutator4.
GetMatrix() == matrix);
276 ASSERT_TRUE(mutator == copy);
281 ASSERT_TRUE(mutator2 == copy2);
286 ASSERT_TRUE(mutator2se == copy2se);
291 ASSERT_TRUE(mutator3 == copy3);
296 ASSERT_TRUE(mutator4 == copy4);
301 ASSERT_TRUE(mutator5 == copy5);
306 ASSERT_TRUE(mutator6 == copy6);
313 ASSERT_TRUE(mutator == other_mutator);
318 ASSERT_TRUE(mutator2 == other_mutator2);
323 ASSERT_TRUE(mutator3 == other_mutator3);
328 ASSERT_TRUE(mutator3se == other_mutator3se);
333 ASSERT_TRUE(mutator4 == other_mutator4);
334 ASSERT_FALSE(mutator2 == mutator);
339 ASSERT_TRUE(mutator5 == other_mutator5);
345 ASSERT_TRUE(mutator6 == other_mutator6);
353 ASSERT_TRUE(not_equal_mutator != mutator);
356 uint8_t alpha2 = 241;
359 ASSERT_TRUE(mutator2 != other_mutator2);
365 ASSERT_TRUE(mutator3 != other_mutator3);
static std::shared_ptr< DlImageFilter > MakeBlur(DlScalar sigma_x, DlScalar sigma_y, DlTileMode tile_mode)
const DlImageFilter & GetFilter() const
const DlMatrix & GetMatrix() const
const ImageFilterMutation & GetFilterMutation() const
MutatorType GetType() const
const DlPath & GetPath() const
const DlRoundSuperellipse & GetRSE() const
const DlRect & GetRect() const
const DlRoundRect & GetRRect() const
void PushTransform(const DlMatrix &matrix)
void PushBackdropFilter(const std::shared_ptr< DlImageFilter > &filter, const DlRect &filter_rect)
void PushClipRect(const DlRect &rect)
void PushClipPath(const DlPath &path)
void PushPlatformViewClipRect(const DlRect &rect)
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Top() const
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Bottom() const
void PushPlatformViewClipRRect(const DlRoundRect &rrect)
void PushPlatformViewClipPath(const DlPath &path)
const std::vector< std::shared_ptr< Mutator > >::const_iterator End() const
void PushClipRRect(const DlRoundRect &rrect)
void PushOpacity(const uint8_t &alpha)
void PushClipRSE(const DlRoundSuperellipse &rrect)
void PushPlatformViewClipRSuperellipse(const DlRoundSuperellipse &rse)
const std::vector< std::shared_ptr< Mutator > >::const_iterator Begin() const
TEST(NativeAssetsManagerTest, NoAvailableAssets)
impeller::RoundRect DlRoundRect
impeller::RoundSuperellipse DlRoundSuperellipse
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
@ kBackdropClipRSuperellipse
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeScale(const Vector3 &s)
static constexpr TRect MakeXYWH(Type x, Type y, Type width, Type height)