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

Interface implemented by all platform surfaces that can present a metal backing store to the "screen". The GPU surface abstraction (which abstracts the client rendering API) uses this delegation pattern to tell the platform surface (which abstracts how backing stores fulfilled by the selected client rendering API end up on the "screen" on a particular platform) when the rasterizer needs to allocate and present the software backing store. More...

#include <gpu_surface_metal_delegate.h>

Inheritance diagram for flutter::GPUSurfaceMetalDelegate:
flutter::EmbedderSurfaceMetalImpeller flutter::EmbedderSurfaceMetalSkia flutter::IOSSurfaceMetalImpeller flutter::IOSSurfaceMetalSkia flutter::testing::ShellTestPlatformViewMetal flutter::testing::TestGPUSurfaceMetalDelegate

Public Member Functions

 GPUSurfaceMetalDelegate (MTLRenderTargetType render_target)
 Construct a new GPUSurfaceMetalDelegate object with the specified render_target type. More...
 
virtual ~GPUSurfaceMetalDelegate ()
 
virtual GPUCAMetalLayerHandle GetCAMetalLayer (const SkISize &frame_info) const =0
 Returns the handle to the CAMetalLayer to render to. This is only called when the specified render target type is kCAMetalLayer. More...
 
virtual bool PresentDrawable (GrMTLHandle drawable) const =0
 Presents the drawable to the "screen". The drawable is obtained from the CAMetalLayer that given by GetCAMetalLayer call. This is only called when the specified render target type in kCAMetalLayer. More...
 
virtual GPUMTLTextureInfo GetMTLTexture (const SkISize &frame_info) const =0
 Returns the handle to the MTLTexture to render to. This is only called when the specified render target type is kMTLTexture. More...
 
virtual bool PresentTexture (GPUMTLTextureInfo texture) const =0
 Presents the texture with texture_id to the "screen". texture_id corresponds to a texture that has been obtained by an earlier call to GetMTLTexture. This is only called when the specified render target type is kMTLTexture. More...
 
virtual bool AllowsDrawingWhenGpuDisabled () const
 Whether to allow drawing to the surface when the GPU is disabled. More...
 
MTLRenderTargetType GetRenderTargetType ()
 

Detailed Description

Interface implemented by all platform surfaces that can present a metal backing store to the "screen". The GPU surface abstraction (which abstracts the client rendering API) uses this delegation pattern to tell the platform surface (which abstracts how backing stores fulfilled by the selected client rendering API end up on the "screen" on a particular platform) when the rasterizer needs to allocate and present the software backing store.

See also
|IOSurfaceMetal| and |EmbedderSurfaceMetal|.

Definition at line 52 of file gpu_surface_metal_delegate.h.

Constructor & Destructor Documentation

◆ GPUSurfaceMetalDelegate()

flutter::GPUSurfaceMetalDelegate::GPUSurfaceMetalDelegate ( MTLRenderTargetType  render_target)
explicit

Construct a new GPUSurfaceMetalDelegate object with the specified render_target type.

See also
|MTLRenderTargetType|

Definition at line 9 of file gpu_surface_metal_delegate.cc.

11 : render_target_type_(render_target_type) {}

◆ ~GPUSurfaceMetalDelegate()

flutter::GPUSurfaceMetalDelegate::~GPUSurfaceMetalDelegate ( )
virtualdefault

Member Function Documentation

◆ AllowsDrawingWhenGpuDisabled()

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

Whether to allow drawing to the surface when the GPU is disabled.

Reimplemented in flutter::testing::TestGPUSurfaceMetalDelegate.

Definition at line 19 of file gpu_surface_metal_delegate.cc.

19 {
20 return true;
21}

◆ GetCAMetalLayer()

virtual GPUCAMetalLayerHandle flutter::GPUSurfaceMetalDelegate::GetCAMetalLayer ( const SkISize frame_info) const
pure virtual

Returns the handle to the CAMetalLayer to render to. This is only called when the specified render target type is kCAMetalLayer.

Implemented in flutter::testing::TestGPUSurfaceMetalDelegate.

◆ GetMTLTexture()

virtual GPUMTLTextureInfo flutter::GPUSurfaceMetalDelegate::GetMTLTexture ( const SkISize frame_info) const
pure virtual

Returns the handle to the MTLTexture to render to. This is only called when the specified render target type is kMTLTexture.

Implemented in flutter::testing::TestGPUSurfaceMetalDelegate.

◆ GetRenderTargetType()

MTLRenderTargetType flutter::GPUSurfaceMetalDelegate::GetRenderTargetType ( )

Definition at line 15 of file gpu_surface_metal_delegate.cc.

15 {
16 return render_target_type_;
17}

◆ PresentDrawable()

virtual bool flutter::GPUSurfaceMetalDelegate::PresentDrawable ( GrMTLHandle  drawable) const
pure virtual

Presents the drawable to the "screen". The drawable is obtained from the CAMetalLayer that given by GetCAMetalLayer call. This is only called when the specified render target type in kCAMetalLayer.

See also
|GPUSurfaceMetalDelegate::GetCAMetalLayer|

Implemented in flutter::testing::TestGPUSurfaceMetalDelegate.

◆ PresentTexture()

virtual bool flutter::GPUSurfaceMetalDelegate::PresentTexture ( GPUMTLTextureInfo  texture) const
pure virtual

Presents the texture with texture_id to the "screen". texture_id corresponds to a texture that has been obtained by an earlier call to GetMTLTexture. This is only called when the specified render target type is kMTLTexture.

See also
|GPUSurfaceMetalDelegate::GetMTLTexture|

Implemented in flutter::testing::TestGPUSurfaceMetalDelegate.


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