Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::TestGPUSurfaceMetalDelegate Class Reference
Inheritance diagram for flutter::testing::TestGPUSurfaceMetalDelegate:
flutter::GPUSurfaceMetalDelegate

Public Member Functions

 TestGPUSurfaceMetalDelegate ()
 
 ~TestGPUSurfaceMetalDelegate ()=default
 
GPUCAMetalLayerHandle GetCAMetalLayer (const SkISize &frame_info) const override
 Returns the handle to the CAMetalLayer to render to. This is only called when the specified render target type is kCAMetalLayer. More...
 
bool PresentDrawable (GrMTLHandle drawable) const override
 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...
 
GPUMTLTextureInfo GetMTLTexture (const SkISize &frame_info) const override
 Returns the handle to the MTLTexture to render to. This is only called when the specified render target type is kMTLTexture. More...
 
bool PresentTexture (GPUMTLTextureInfo texture) const override
 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...
 
bool AllowsDrawingWhenGpuDisabled () const override
 Whether to allow drawing to the surface when the GPU is disabled. More...
 
void SetDevice ()
 
- Public Member Functions inherited from flutter::GPUSurfaceMetalDelegate
 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

Definition at line 18 of file gpu_surface_metal_impeller_unittests.mm.

Constructor & Destructor Documentation

◆ TestGPUSurfaceMetalDelegate()

flutter::testing::TestGPUSurfaceMetalDelegate::TestGPUSurfaceMetalDelegate ( )
inline

Definition at line 20 of file gpu_surface_metal_impeller_unittests.mm.

21 layer_ = [[CAMetalLayer alloc] init];
22 }
GPUSurfaceMetalDelegate(MTLRenderTargetType render_target)
Construct a new GPUSurfaceMetalDelegate object with the specified render_target type.
static bool init()

◆ ~TestGPUSurfaceMetalDelegate()

flutter::testing::TestGPUSurfaceMetalDelegate::~TestGPUSurfaceMetalDelegate ( )
default

Member Function Documentation

◆ AllowsDrawingWhenGpuDisabled()

bool flutter::testing::TestGPUSurfaceMetalDelegate::AllowsDrawingWhenGpuDisabled ( ) const
inlineoverridevirtual

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

Reimplemented from flutter::GPUSurfaceMetalDelegate.

Definition at line 37 of file gpu_surface_metal_impeller_unittests.mm.

37{ return true; }

◆ GetCAMetalLayer()

GPUCAMetalLayerHandle flutter::testing::TestGPUSurfaceMetalDelegate::GetCAMetalLayer ( const SkISize frame_info) const
inlineoverridevirtual

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

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 26 of file gpu_surface_metal_impeller_unittests.mm.

26 {
27 layer_.drawableSize = CGSizeMake(frame_info.width(), frame_info.height());
28 return (__bridge GPUCAMetalLayerHandle)(layer_);
29 }
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ GetMTLTexture()

GPUMTLTextureInfo flutter::testing::TestGPUSurfaceMetalDelegate::GetMTLTexture ( const SkISize frame_info) const
inlineoverridevirtual

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

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 33 of file gpu_surface_metal_impeller_unittests.mm.

33{ return {}; }

◆ PresentDrawable()

bool flutter::testing::TestGPUSurfaceMetalDelegate::PresentDrawable ( GrMTLHandle  drawable) const
inlineoverridevirtual

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|

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 31 of file gpu_surface_metal_impeller_unittests.mm.

31{ return true; }

◆ PresentTexture()

bool flutter::testing::TestGPUSurfaceMetalDelegate::PresentTexture ( GPUMTLTextureInfo  texture) const
inlineoverridevirtual

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|

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 35 of file gpu_surface_metal_impeller_unittests.mm.

35{ return true; }

◆ SetDevice()

void flutter::testing::TestGPUSurfaceMetalDelegate::SetDevice ( )
inline

Definition at line 39 of file gpu_surface_metal_impeller_unittests.mm.

39{ layer_.device = ::MTLCreateSystemDefaultDevice(); }

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