Flutter Engine
 
Loading...
Searching...
No Matches
flutter::testing::SaveLayerExpector Class Reference
Inheritance diagram for flutter::testing::SaveLayerExpector:
flutter::DlOpReceiver flutter::IgnoreAttributeDispatchHelper flutter::IgnoreClipDispatchHelper flutter::IgnoreTransformDispatchHelper flutter::IgnoreDrawDispatchHelper flutter::DlOpReceiver flutter::DlOpReceiver flutter::DlOpReceiver flutter::DlOpReceiver

Public Member Functions

 SaveLayerExpector (const std::string &file, int line)
 
 ~SaveLayerExpector ()
 
SaveLayerExpectoraddDetail (const std::string &detail)
 
SaveLayerExpectoraddExpectation (const SaveLayerExpectations &expected)
 
SaveLayerExpectoraddExpectation (const SaveLayerOptionsTester &tester)
 
SaveLayerExpectoraddOpenExpectation ()
 
void saveLayer (const DlRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override
 
virtual void saveLayer (const DlRect &bounds, const SaveLayerOptions &options, uint32_t total_content_depth, DlBlendMode max_content_blend_mode, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)
 
bool all_expectations_checked () const
 
- Public Member Functions inherited from flutter::DlOpReceiver
virtual void save (uint32_t total_content_depth)
 
virtual void saveLayer (const DlRect *bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt) final
 
- Public Member Functions inherited from flutter::IgnoreAttributeDispatchHelper
void setAntiAlias (bool aa) override
 
void setInvertColors (bool invert) override
 
void setStrokeCap (DlStrokeCap cap) override
 
void setStrokeJoin (DlStrokeJoin join) override
 
void setDrawStyle (DlDrawStyle style) override
 
void setStrokeWidth (float width) override
 
void setStrokeMiter (float limit) override
 
void setColor (DlColor color) override
 
void setBlendMode (DlBlendMode mode) override
 
void setColorSource (const DlColorSource *source) override
 
void setImageFilter (const DlImageFilter *filter) override
 
void setColorFilter (const DlColorFilter *filter) override
 
void setMaskFilter (const DlMaskFilter *filter) override
 
- Public Member Functions inherited from flutter::IgnoreTransformDispatchHelper
void translate (DlScalar tx, DlScalar ty) override
 
void scale (DlScalar sx, DlScalar sy) override
 
void rotate (DlScalar degrees) override
 
void skew (DlScalar sx, DlScalar sy) override
 
void transform2DAffine (DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override
 
void transformFullPerspective (DlScalar mxx, DlScalar mxy, DlScalar mxz, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myz, DlScalar myt, DlScalar mzx, DlScalar mzy, DlScalar mzz, DlScalar mzt, DlScalar mwx, DlScalar mwy, DlScalar mwz, DlScalar mwt) override
 
void transformReset () override
 
- Public Member Functions inherited from flutter::IgnoreDrawDispatchHelper
void save () override
 
void restore () override
 
void drawColor (DlColor color, DlBlendMode mode) override
 
void drawPaint () override
 
void drawLine (const DlPoint &p0, const DlPoint &p1) override
 
void drawDashedLine (const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length) override
 
void drawRect (const DlRect &rect) override
 
void drawOval (const DlRect &bounds) override
 
void drawCircle (const DlPoint &center, DlScalar radius) override
 
void drawRoundRect (const DlRoundRect &rrect) override
 
void drawDiffRoundRect (const DlRoundRect &outer, const DlRoundRect &inner) override
 
void drawRoundSuperellipse (const DlRoundSuperellipse &rse) override
 
void drawPath (const DlPath &path) override
 
void drawArc (const DlRect &oval_bounds, DlScalar start_degrees, DlScalar sweep_degrees, bool use_center) override
 
void drawPoints (DlPointMode mode, uint32_t count, const DlPoint points[]) override
 
void drawVertices (const std::shared_ptr< DlVertices > &vertices, DlBlendMode mode) override
 
void drawImage (const sk_sp< DlImage > image, const DlPoint &point, DlImageSampling sampling, bool render_with_attributes) override
 
void drawImageRect (const sk_sp< DlImage > image, const DlRect &src, const DlRect &dst, DlImageSampling sampling, bool render_with_attributes, DlSrcRectConstraint constraint) override
 
void drawImageNine (const sk_sp< DlImage > image, const DlIRect &center, const DlRect &dst, DlFilterMode filter, bool render_with_attributes) override
 
void drawAtlas (const sk_sp< DlImage > atlas, const DlRSTransform xform[], const DlRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const DlRect *cull_rect, bool render_with_attributes) override
 
void drawDisplayList (const sk_sp< DisplayList > display_list, DlScalar opacity) override
 
void drawText (const std::shared_ptr< DlText > &text, DlScalar x, DlScalar y) override
 
void drawShadow (const DlPath &path, const DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override
 

Additional Inherited Members

- Static Public Attributes inherited from flutter::DlOpReceiver
static constexpr int kMaxDrawPointsCount = ((1 << 29) - 1)
 

Detailed Description

Definition at line 1396 of file display_list_unittests.cc.

Constructor & Destructor Documentation

◆ SaveLayerExpector()

flutter::testing::SaveLayerExpector::SaveLayerExpector ( const std::string &  file,
int  line 
)
inline

Definition at line 1402 of file display_list_unittests.cc.

1403 : file_(file), line_(line), detail_("") {}

◆ ~SaveLayerExpector()

flutter::testing::SaveLayerExpector::~SaveLayerExpector ( )
inline

Definition at line 1405 of file display_list_unittests.cc.

1405 { //
1406 EXPECT_EQ(save_layer_count_, expected_.size()) << label();
1407 while (save_layer_count_ < expected_.size()) {
1408 auto expect = expected_[save_layer_count_];
1409 FML_LOG(ERROR) << "leftover expectation[" << save_layer_count_
1410 << "] = " << expect;
1411 save_layer_count_++;
1412 }
1413 }
#define FML_LOG(severity)
Definition logging.h:101

References FML_LOG.

Member Function Documentation

◆ addDetail()

SaveLayerExpector & flutter::testing::SaveLayerExpector::addDetail ( const std::string &  detail)
inline

Definition at line 1415 of file display_list_unittests.cc.

1415 {
1416 detail_ = detail;
1417 return *this;
1418 }

◆ addExpectation() [1/2]

SaveLayerExpector & flutter::testing::SaveLayerExpector::addExpectation ( const SaveLayerExpectations expected)
inline

Definition at line 1420 of file display_list_unittests.cc.

1420 {
1421 expected_.push_back(expected);
1422 return *this;
1423 }

◆ addExpectation() [2/2]

SaveLayerExpector & flutter::testing::SaveLayerExpector::addExpectation ( const SaveLayerOptionsTester tester)
inline

Definition at line 1425 of file display_list_unittests.cc.

1425 {
1426 expected_.push_back(SaveLayerExpectations(tester));
1427 return *this;
1428 }

◆ addOpenExpectation()

SaveLayerExpector & flutter::testing::SaveLayerExpector::addOpenExpectation ( )
inline

Definition at line 1430 of file display_list_unittests.cc.

1430 {
1431 expected_.push_back(SaveLayerExpectations());
1432 return *this;
1433 }

◆ all_expectations_checked()

bool flutter::testing::SaveLayerExpector::all_expectations_checked ( ) const
inline

Definition at line 1463 of file display_list_unittests.cc.

1463 {
1464 return save_layer_count_ == expected_.size();
1465 }

◆ saveLayer() [1/2]

virtual void flutter::testing::SaveLayerExpector::saveLayer ( const DlRect bounds,
const SaveLayerOptions options,
uint32_t  total_content_depth,
DlBlendMode  max_content_blend_mode,
const DlImageFilter backdrop = nullptr,
std::optional< int64_t >  backdrop_id = std::nullopt 
)
inlinevirtual

Reimplemented from flutter::DlOpReceiver.

Definition at line 1442 of file display_list_unittests.cc.

1447 {
1448 ASSERT_LT(save_layer_count_, expected_.size()) << label();
1449 auto expect = expected_[save_layer_count_];
1450 if (expect.options.has_value()) {
1451 EXPECT_EQ(options, expect.options.value()) << label();
1452 }
1453 if (expect.tester.has_value()) {
1454 EXPECT_TRUE(expect.tester.value()(options)) << label();
1455 }
1456 if (expect.max_blend_mode.has_value()) {
1457 EXPECT_EQ(max_content_blend_mode, expect.max_blend_mode.value())
1458 << label();
1459 }
1460 save_layer_count_++;
1461 }

◆ saveLayer() [2/2]

void flutter::testing::SaveLayerExpector::saveLayer ( const DlRect bounds,
const SaveLayerOptions  options,
const DlImageFilter backdrop,
std::optional< int64_t >  backdrop_id 
)
inlineoverridevirtual

Implements flutter::DlOpReceiver.

Definition at line 1435 of file display_list_unittests.cc.

1438 {
1440 }
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE.


The documentation for this class was generated from the following file: