Flutter Engine
 
Loading...
Searching...
No Matches
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::GPUSurfaceNoop 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 DlISize &size)=0
 
virtual DlMatrix GetRootTransformation () const =0
 
virtual GrDirectContext * GetContext ()=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 26 of file surface.h.

Constructor & Destructor Documentation

◆ Surface()

flutter::Surface::Surface ( )
default

◆ ~Surface()

flutter::Surface::~Surface ( )
virtualdefault

Reimplemented in flutter_runner::Surface.

Member Function Documentation

◆ AcquireFrame()

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

◆ AllowsDrawingWhenGpuDisabled()

bool flutter::Surface::AllowsDrawingWhenGpuDisabled ( ) const
virtual

Reimplemented in flutter::GPUSurfaceGLSkia.

Definition at line 21 of file surface.cc.

21 {
22 return true;
23}

◆ ClearRenderContext()

bool flutter::Surface::ClearRenderContext ( )
virtual

Reimplemented in flutter::GPUSurfaceGLSkia.

Definition at line 17 of file surface.cc.

17 {
18 return false;
19}

◆ EnableRasterCache()

bool flutter::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 > flutter::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 DlMatrix flutter::Surface::GetRootTransformation ( ) const
pure virtual

◆ GetSurfaceData()

Surface::SurfaceData flutter::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, and flutter::GPUSurfaceNoop.

Definition at line 33 of file surface.cc.

33 {
34 return {};
35}

◆ IsValid()

◆ MakeRenderContextCurrent()

std::unique_ptr< GLContextResult > flutter::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: