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

Public Member Functions

 SaveLayerBoundsExpector ()
 
SaveLayerBoundsExpectoraddComputedExpectation (const DlRect &bounds)
 
SaveLayerBoundsExpectoraddSuppliedExpectation (const DlRect &bounds, bool clipped=false)
 
void saveLayer (const DlRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override
 
bool all_bounds_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, uint32_t total_content_depth, DlBlendMode max_content_blend_mode, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)
 
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 3629 of file display_list_unittests.cc.

Constructor & Destructor Documentation

◆ SaveLayerBoundsExpector()

flutter::testing::SaveLayerBoundsExpector::SaveLayerBoundsExpector ( )
inlineexplicit

Definition at line 3635 of file display_list_unittests.cc.

3635{}

Member Function Documentation

◆ addComputedExpectation()

SaveLayerBoundsExpector & flutter::testing::SaveLayerBoundsExpector::addComputedExpectation ( const DlRect bounds)
inline

◆ addSuppliedExpectation()

SaveLayerBoundsExpector & flutter::testing::SaveLayerBoundsExpector::addSuppliedExpectation ( const DlRect bounds,
bool  clipped = false 
)
inline

Definition at line 3645 of file display_list_unittests.cc.

3646 {
3647 SaveLayerOptions options;
3648 options = options.with_bounds_from_caller();
3649 if (clipped) {
3650 options = options.with_content_is_clipped();
3651 }
3652 expected_.emplace_back(BoundsExpectation{
3653 .bounds = bounds,
3654 .options = options,
3655 });
3656 return *this;
3657 }
SaveLayerOptions with_bounds_from_caller() const
SaveLayerOptions with_content_is_clipped() const

References flutter::SaveLayerOptions::with_bounds_from_caller(), and flutter::SaveLayerOptions::with_content_is_clipped().

Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ all_bounds_checked()

◆ saveLayer()

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

Implements flutter::DlOpReceiver.

Definition at line 3659 of file display_list_unittests.cc.

3662 {
3663 ASSERT_LT(save_layer_count_, expected_.size());
3664 auto expected = expected_[save_layer_count_];
3665 EXPECT_EQ(options.bounds_from_caller(),
3666 expected.options.bounds_from_caller())
3667 << "expected bounds index " << save_layer_count_;
3668 EXPECT_EQ(options.content_is_clipped(),
3669 expected.options.content_is_clipped())
3670 << "expected bounds index " << save_layer_count_;
3671 if (!DlScalarNearlyEqual(bounds.GetLeft(), expected.bounds.GetLeft()) ||
3672 !DlScalarNearlyEqual(bounds.GetTop(), expected.bounds.GetTop()) ||
3673 !DlScalarNearlyEqual(bounds.GetRight(), expected.bounds.GetRight()) ||
3674 !DlScalarNearlyEqual(bounds.GetBottom(), expected.bounds.GetBottom())) {
3675 EXPECT_EQ(bounds, expected.bounds)
3676 << "expected bounds index " << save_layer_count_;
3677 }
3678 save_layer_count_++;
3679 }
constexpr bool DlScalarNearlyEqual(DlScalar x, DlScalar y, DlScalar tolerance=kEhCloseEnough)

References flutter::SaveLayerOptions::bounds_from_caller(), flutter::SaveLayerOptions::content_is_clipped(), flutter::DlScalarNearlyEqual(), impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), and impeller::TRect< T >::GetTop().


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