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

#include <dl_test_surface_software.h>

Inheritance diagram for flutter::testing::DlSoftwareSurfaceProvider:
flutter::testing::DlSurfaceProvider

Public Member Functions

 DlSoftwareSurfaceProvider ()=default
 
virtual ~DlSoftwareSurfaceProvider ()=default
 
bool InitializeSurface (size_t width, size_t height, PixelFormat format) override
 
std::shared_ptr< DlSurfaceInstanceGetPrimarySurface () const override
 
std::shared_ptr< DlSurfaceInstanceMakeOffscreenSurface (size_t width, size_t height, PixelFormat format) const override
 
const std::string backend_name () const override
 
BackendType backend_type () const override
 
bool supports (PixelFormat format) const override
 
- Public Member Functions inherited from flutter::testing::DlSurfaceProvider
virtual ~DlSurfaceProvider ()=default
 
virtual bool supports_impeller () const
 
virtual bool Snapshot (std::string &filename) const
 
virtual sk_sp< DlPixelDataImpellerSnapshot (const sk_sp< DisplayList > &list, int width, int height) const
 
virtual sk_sp< DlImageMakeImpellerImage (const sk_sp< DisplayList > &list, int width, int height) const
 

Additional Inherited Members

- Public Types inherited from flutter::testing::DlSurfaceProvider
enum  PixelFormat {
  kN32PremulPixelFormat ,
  k565PixelFormat
}
 
enum  BackendType {
  kSoftwareBackend ,
  kOpenGlBackend ,
  kMetalBackend
}
 
- Static Public Member Functions inherited from flutter::testing::DlSurfaceProvider
static SkImageInfo MakeInfo (PixelFormat format, int w, int h)
 
static std::string BackendName (BackendType type)
 
static std::unique_ptr< DlSurfaceProviderCreate (BackendType backend_type)
 
- Protected Member Functions inherited from flutter::testing::DlSurfaceProvider
 DlSurfaceProvider ()=default
 

Detailed Description

Definition at line 13 of file dl_test_surface_software.h.

Constructor & Destructor Documentation

◆ DlSoftwareSurfaceProvider()

flutter::testing::DlSoftwareSurfaceProvider::DlSoftwareSurfaceProvider ( )
default

◆ ~DlSoftwareSurfaceProvider()

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

Member Function Documentation

◆ backend_name()

const std::string flutter::testing::DlSoftwareSurfaceProvider::backend_name ( ) const
inlineoverridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 28 of file dl_test_surface_software.h.

28{ return "Software"; }

◆ backend_type()

BackendType flutter::testing::DlSoftwareSurfaceProvider::backend_type ( ) const
inlineoverridevirtual

◆ GetPrimarySurface()

std::shared_ptr< DlSurfaceInstance > flutter::testing::DlSoftwareSurfaceProvider::GetPrimarySurface ( ) const
inlineoverridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 21 of file dl_test_surface_software.h.

21 {
22 return primary_;
23 }

◆ InitializeSurface()

bool flutter::testing::DlSoftwareSurfaceProvider::InitializeSurface ( size_t  width,
size_t  height,
PixelFormat  format 
)
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 14 of file dl_test_surface_software.cc.

16 {
17 primary_ = MakeOffscreenSurface(width, height, format);
18 return primary_ != nullptr;
19}
std::shared_ptr< DlSurfaceInstance > MakeOffscreenSurface(size_t width, size_t height, PixelFormat format) const override
int32_t height
int32_t width

References format, height, MakeOffscreenSurface(), and width.

◆ MakeOffscreenSurface()

std::shared_ptr< DlSurfaceInstance > flutter::testing::DlSoftwareSurfaceProvider::MakeOffscreenSurface ( size_t  width,
size_t  height,
PixelFormat  format 
) const
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 22 of file dl_test_surface_software.cc.

24 {
25 auto surface = SkSurfaces::Raster(MakeInfo(format, width, height));
26 surface->getCanvas()->clear(SK_ColorTRANSPARENT);
27 return std::make_shared<DlSurfaceInstanceBase>(surface);
28}
static SkImageInfo MakeInfo(PixelFormat format, int w, int h)
VkSurfaceKHR surface
Definition main.cc:65

References format, height, flutter::testing::DlSurfaceProvider::MakeInfo(), surface, and width.

Referenced by InitializeSurface().

◆ supports()

bool flutter::testing::DlSoftwareSurfaceProvider::supports ( PixelFormat  format) const
inlineoverridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 30 of file dl_test_surface_software.h.

30{ return true; }

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