Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::testing::DlSurfaceInstance Class Referenceabstract

#include <dl_test_surface_provider.h>

Inheritance diagram for flutter::testing::DlSurfaceInstance:
flutter::testing::DlSurfaceInstanceImpeller flutter::testing::DlSurfaceInstanceSkiaBase flutter::testing::DlMetalSurfaceInstance flutter::testing::DlSurfaceInstanceSkia

Public Member Functions

virtual ~DlSurfaceInstance ()=default
 
virtual void Clear (const DlColor &color)=0
 Clear the entire surface to the indicated color.
 
virtual DlCanvasGetCanvas ()=0
 
virtual void RenderDisplayList (const sk_sp< DisplayList > &display_list)=0
 
virtual void FlushSubmitCpuSync ()=0
 
virtual std::unique_ptr< DlPixelDataSnapshotToPixelData () const =0
 
virtual sk_sp< DlImageSnapshotToImage () const =0
 
virtual bool SnapshotToFile (std::string &filename) const =0
 Store a snapshot of this Surface to the file indicated by the filename.
 
DlISize GetSize () const
 The size of the underlying surface.
 
virtual int width () const =0
 The width of the underlying surface.
 
virtual int height () const =0
 The height of the underlying surface.
 
virtual sk_sp< SkSurface > sk_surface ()
 

Detailed Description

Definition at line 31 of file dl_test_surface_provider.h.

Constructor & Destructor Documentation

◆ ~DlSurfaceInstance()

virtual flutter::testing::DlSurfaceInstance::~DlSurfaceInstance ( )
virtualdefault

Member Function Documentation

◆ Clear()

virtual void flutter::testing::DlSurfaceInstance::Clear ( const DlColor color)
pure virtual

Clear the entire surface to the indicated color.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ FlushSubmitCpuSync()

virtual void flutter::testing::DlSurfaceInstance::FlushSubmitCpuSync ( )
pure virtual

Ensure that all outstanding calls executed on the DlCanvas instance are rendered to the surface.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ GetCanvas()

virtual DlCanvas * flutter::testing::DlSurfaceInstance::GetCanvas ( )
pure virtual

Return a DlCanvas instance that renders to this surface. Note that actual execution of the rendering calls are not guaranteed until the FlushSubmitCpuSync method is called. The DlCanvas will also be reset by the operations of the sync method so transform and clip state will not be carried over to subsequent calls.

Rendering to this canvas does not necessarily render the commands immediately in all backends, some backends accumulate the commands into a DisplayList and only flush that DisplayList when the FlushSubmitCpuSync is called. Tests should strongly prefer using RenderDisplayList instead of multiple calls on this canvas object.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ GetSize()

DlISize flutter::testing::DlSurfaceInstance::GetSize ( ) const
inline

The size of the underlying surface.

Definition at line 76 of file dl_test_surface_provider.h.

76{ return DlISize(width(), height()); }
virtual int height() const =0
The height of the underlying surface.
virtual int width() const =0
The width of the underlying surface.
impeller::ISize32 DlISize

References height(), and width().

◆ height()

virtual int flutter::testing::DlSurfaceInstance::height ( ) const
pure virtual

The height of the underlying surface.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

Referenced by GetSize().

◆ RenderDisplayList()

virtual void flutter::testing::DlSurfaceInstance::RenderDisplayList ( const sk_sp< DisplayList > &  display_list)
pure virtual

Render the indicated DisplayList to the surface. Note that the commands may be enqueued by this call and will be rendered at some time in the future, but the caller must call FlushSubmitCpuSync to be sure they are done being rendered.

In some cases this may be faster than using: GetCanvas().DrawDisplayList(display_list);

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ sk_surface()

virtual sk_sp< SkSurface > flutter::testing::DlSurfaceInstance::sk_surface ( )
inlinevirtual

Return a pointer to an underlying SkSurface if the image instance has one. THIS METHOD IS DEPRECATED AND ONLY USED IN DL_RENDERING_UNITTESTS.

Reimplemented in flutter::testing::DlSurfaceInstanceSkiaBase.

Definition at line 87 of file dl_test_surface_provider.h.

87{ return nullptr; }

◆ SnapshotToFile()

virtual bool flutter::testing::DlSurfaceInstance::SnapshotToFile ( std::string &  filename) const
pure virtual

Store a snapshot of this Surface to the file indicated by the filename.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ SnapshotToImage()

virtual sk_sp< DlImage > flutter::testing::DlSurfaceInstance::SnapshotToImage ( ) const
pure virtual

Return the current contents of the surface as a DlImage compatible with the DlCanvas that it provides.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ SnapshotToPixelData()

virtual std::unique_ptr< DlPixelData > flutter::testing::DlSurfaceInstance::SnapshotToPixelData ( ) const
pure virtual

Read back the current contents of the surface and return it as a DlPixelData structure.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

◆ width()

virtual int flutter::testing::DlSurfaceInstance::width ( ) const
pure virtual

The width of the underlying surface.

Implemented in flutter::testing::DlSurfaceInstanceImpeller, and flutter::testing::DlSurfaceInstanceSkiaBase.

Referenced by GetSize().


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