Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
flutter::Surface Class Referenceabstract

Abstract Base Class that represents where we will be rendering content. More...

#include <surface.h>

Inheritance diagram for flutter::Surface:
flutter::GPUSurfaceGLImpeller flutter::GPUSurfaceGLSkia flutter::GPUSurfaceMetalImpeller flutter::GPUSurfaceMetalSkia flutter::GPUSurfaceSoftware flutter::GPUSurfaceVulkan flutter::GPUSurfaceVulkanImpeller flutter::testing::SurfaceMock flutter_runner::Surface

Classes

struct  SurfaceData
 A screenshot of the surface's raw data. More...
 

Public Member Functions

 Surface ()
 
virtual ~Surface ()
 
virtual bool IsValid ()=0
 
virtual std::unique_ptr< SurfaceFrameAcquireFrame (const SkISize &size)=0
 
virtual SkMatrix GetRootTransformation () const =0
 
virtual GrDirectContextGetContext ()=0
 
virtual std::unique_ptr< GLContextResultMakeRenderContextCurrent ()
 
virtual bool ClearRenderContext ()
 
virtual bool AllowsDrawingWhenGpuDisabled () const
 
virtual bool EnableRasterCache () const
 
virtual std::shared_ptr< impeller::AiksContextGetAiksContext () const
 
virtual SurfaceData GetSurfaceData () const
 

Detailed Description

Abstract Base Class that represents where we will be rendering content.

Definition at line 24 of file surface.h.

Constructor & Destructor Documentation

◆ Surface()

Surface::Surface ( )
default

◆ ~Surface()

Surface::~Surface ( )
virtualdefault

Reimplemented in flutter_runner::Surface.

Member Function Documentation

◆ AcquireFrame()

virtual std::unique_ptr< SurfaceFrame > flutter::Surface::AcquireFrame ( const SkISize size)
pure virtual

◆ AllowsDrawingWhenGpuDisabled()

bool Surface::AllowsDrawingWhenGpuDisabled ( ) const
virtual

Reimplemented in flutter::GPUSurfaceGLSkia.

Definition at line 21 of file surface.cc.

21 {
22 return true;
23}

◆ ClearRenderContext()

bool Surface::ClearRenderContext ( )
virtual

Reimplemented in flutter::GPUSurfaceGLSkia.

Definition at line 17 of file surface.cc.

17 {
18 return false;
19}

◆ EnableRasterCache()

bool Surface::EnableRasterCache ( ) const
virtual

Reimplemented in flutter::TesterGPUSurfaceSoftware.

Definition at line 25 of file surface.cc.

25 {
26 return true;
27}

◆ GetAiksContext()

std::shared_ptr< impeller::AiksContext > Surface::GetAiksContext ( ) const
virtual

Definition at line 29 of file surface.cc.

29 {
30 return nullptr;
31}

◆ GetContext()

virtual GrDirectContext * flutter::Surface::GetContext ( )
pure virtual

◆ GetRootTransformation()

virtual SkMatrix flutter::Surface::GetRootTransformation ( ) const
pure virtual

◆ GetSurfaceData()

Surface::SurfaceData Surface::GetSurfaceData ( ) const
virtual

Capture the SurfaceData currently present in the surface.

Not guaranteed to work on all setups and not intended to be used in production. The data field will be null if it was unable to work.

Reimplemented in flutter::GPUSurfaceMetalImpeller.

Definition at line 33 of file surface.cc.

33 {
34 return {};
35}

◆ IsValid()

virtual bool flutter::Surface::IsValid ( )
pure virtual

◆ MakeRenderContextCurrent()

std::unique_ptr< GLContextResult > Surface::MakeRenderContextCurrent ( )
virtual

Reimplemented in flutter::GPUSurfaceGLSkia.

Definition at line 13 of file surface.cc.

13 {
14 return std::make_unique<GLContextDefaultResult>(true);
15}

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