Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::MockViewEmbedder Class Reference

#include <mock_embedder.h>

Inheritance diagram for flutter::testing::MockViewEmbedder:
flutter::ExternalViewEmbedder

Public Member Functions

 MockViewEmbedder ()
 
 ~MockViewEmbedder ()
 
void AddCanvas (DlCanvas *canvas)
 
DlCanvasGetRootCanvas () override
 
void CancelFrame () override
 
void BeginFrame (GrDirectContext *context, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger) override
 
void PrepareFlutterView (SkISize frame_size, double device_pixel_ratio) override
 
void PrerollCompositeEmbeddedView (int64_t view_id, std::unique_ptr< EmbeddedViewParams > params) override
 
DlCanvasCompositeEmbeddedView (int64_t view_id) override
 
std::vector< int64_t > prerolled_views () const
 
std::vector< int64_t > painted_views () const
 
- Public Member Functions inherited from flutter::ExternalViewEmbedder
 ExternalViewEmbedder ()=default
 
virtual ~ExternalViewEmbedder ()=default
 
virtual void CollectView (int64_t view_id)
 
virtual DlCanvasGetRootCanvas ()=0
 
virtual void CancelFrame ()=0
 
virtual void BeginFrame (GrDirectContext *context, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)=0
 
virtual void PrerollCompositeEmbeddedView (int64_t platform_view_id, std::unique_ptr< EmbeddedViewParams > params)=0
 
virtual PostPrerollResult PostPrerollAction (const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)
 
virtual DlCanvasCompositeEmbeddedView (int64_t platform_view_id)=0
 
virtual void PrepareFlutterView (SkISize frame_size, double device_pixel_ratio)=0
 
virtual void SubmitFlutterView (int64_t flutter_view_id, GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, std::unique_ptr< SurfaceFrame > frame)
 
virtual void EndFrame (bool should_resubmit_frame, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)
 
virtual bool SupportsDynamicThreadMerging ()
 
virtual void Teardown ()
 
void SetUsedThisFrame (bool used_this_frame)
 
bool GetUsedThisFrame () const
 
virtual void PushVisitedPlatformView (int64_t platform_view_id)
 
virtual void PushFilterToVisitedPlatformViews (const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect)
 

Detailed Description

Definition at line 13 of file mock_embedder.h.

Constructor & Destructor Documentation

◆ MockViewEmbedder()

flutter::testing::MockViewEmbedder::MockViewEmbedder ( )
default

◆ ~MockViewEmbedder()

flutter::testing::MockViewEmbedder::~MockViewEmbedder ( )
default

Member Function Documentation

◆ AddCanvas()

void flutter::testing::MockViewEmbedder::AddCanvas ( DlCanvas canvas)

Definition at line 14 of file mock_embedder.cc.

14 {
15 contexts_.emplace_back(canvas);
16}

◆ BeginFrame()

void flutter::testing::MockViewEmbedder::BeginFrame ( GrDirectContext context,
const fml::RefPtr< fml::RasterThreadMerger > &  raster_thread_merger 
)
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 27 of file mock_embedder.cc.

29 {}

◆ CancelFrame()

void flutter::testing::MockViewEmbedder::CancelFrame ( )
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 24 of file mock_embedder.cc.

24{}

◆ CompositeEmbeddedView()

DlCanvas * flutter::testing::MockViewEmbedder::CompositeEmbeddedView ( int64_t  view_id)
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 43 of file mock_embedder.cc.

43 {
44 painted_views_.emplace_back(view_id);
45 DlCanvas* canvas = contexts_.front();
46 contexts_.pop_front();
47 return canvas;
48}
flutter::DlCanvas DlCanvas

◆ GetRootCanvas()

DlCanvas * flutter::testing::MockViewEmbedder::GetRootCanvas ( )
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 19 of file mock_embedder.cc.

19 {
20 return nullptr;
21}

◆ painted_views()

std::vector< int64_t > flutter::testing::MockViewEmbedder::painted_views ( ) const
inline

Definition at line 45 of file mock_embedder.h.

45{ return painted_views_; }

◆ PrepareFlutterView()

void flutter::testing::MockViewEmbedder::PrepareFlutterView ( SkISize  frame_size,
double  device_pixel_ratio 
)
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 32 of file mock_embedder.cc.

33 {}

◆ PrerollCompositeEmbeddedView()

void flutter::testing::MockViewEmbedder::PrerollCompositeEmbeddedView ( int64_t  view_id,
std::unique_ptr< EmbeddedViewParams params 
)
overridevirtual

Implements flutter::ExternalViewEmbedder.

Definition at line 36 of file mock_embedder.cc.

38 {
39 prerolled_views_.emplace_back(view_id);
40}

◆ prerolled_views()

std::vector< int64_t > flutter::testing::MockViewEmbedder::prerolled_views ( ) const
inline

Definition at line 44 of file mock_embedder.h.

44{ return prerolled_views_; }

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