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::unique_ptr< DlSurfaceInstanceMakeOffscreenSurface (size_t width, size_t height, PixelFormat format) const override
 
const std::string GetBackendName () const override
 
BackendType GetBackendType () const override
 
bool SupportsPixelFormat (PixelFormat format) const override
 
bool TargetsImpeller () const override
 
- Public Member Functions inherited from flutter::testing::DlSurfaceProvider
virtual ~DlSurfaceProvider ()=default
 

Additional Inherited Members

- Public Types inherited from flutter::testing::DlSurfaceProvider
enum  PixelFormat {
  kN32Premul ,
  k565
}
 
enum class  BackendType {
  kSkiaSoftware ,
  kSkiaOpenGL ,
  kSkiaMetal ,
  kImpellerMetal ,
  kImpellerMetalSDF
}
 
- Static Public Member Functions inherited from flutter::testing::DlSurfaceProvider
static SkImageInfo MakeInfo (PixelFormat format, int w, int h)
 
static std::optional< BackendTypeNameToBackend (const std::string &name)
 
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

◆ GetBackendName()

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

Implements flutter::testing::DlSurfaceProvider.

Definition at line 28 of file dl_test_surface_software.h.

28{ return "SkiaSoftware"; }

◆ GetBackendType()

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

Implements flutter::testing::DlSurfaceProvider.

Definition at line 29 of file dl_test_surface_software.h.

29 {
30 return BackendType::kSkiaSoftware;
31 }

◆ 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 16 of file dl_test_surface_software.cc.

18 {
19 primary_ = MakeOffscreenSurface(width, height, format);
20 return primary_ != nullptr;
21}
std::unique_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::unique_ptr< DlSurfaceInstance > flutter::testing::DlSoftwareSurfaceProvider::MakeOffscreenSurface ( size_t  width,
size_t  height,
PixelFormat  format 
) const
overridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 24 of file dl_test_surface_software.cc.

26 {
27 auto surface = SkSurfaces::Raster(MakeInfo(format, width, height));
28 surface->getCanvas()->clear(SK_ColorTRANSPARENT);
29 return std::make_unique<DlSurfaceInstanceSkia>(surface);
30}
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().

◆ SupportsPixelFormat()

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

Implements flutter::testing::DlSurfaceProvider.

Definition at line 32 of file dl_test_surface_software.h.

32{ return true; }

◆ TargetsImpeller()

bool flutter::testing::DlSoftwareSurfaceProvider::TargetsImpeller ( ) const
inlineoverridevirtual

Implements flutter::testing::DlSurfaceProvider.

Definition at line 33 of file dl_test_surface_software.h.

33{ return false; }

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