Flutter Engine
 
Loading...
Searching...
No Matches
flutter::testing::TestGPUSurfaceMetalDelegate Class Reference
Inheritance diagram for flutter::testing::TestGPUSurfaceMetalDelegate:
flutter::GPUSurfaceMetalDelegate

Public Member Functions

 TestGPUSurfaceMetalDelegate ()
 
 ~TestGPUSurfaceMetalDelegate ()=default
 
GPUCAMetalLayerHandle GetCAMetalLayer (const DlISize &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.
 
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.
 
GPUMTLTextureInfo GetMTLTexture (const DlISize &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.
 
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.
 
bool AllowsDrawingWhenGpuDisabled () const override
 Whether to allow drawing to the surface when the GPU is disabled.
 
void SetDevice ()
 
- Public Member Functions inherited from flutter::GPUSurfaceMetalDelegate
 GPUSurfaceMetalDelegate (MTLRenderTargetType render_target)
 Construct a new GPUSurfaceMetalDelegate object with the specified render_target type.
 
virtual ~GPUSurfaceMetalDelegate ()
 
virtual bool PreparePresent (GrMTLHandle drawable) const
 
MTLRenderTargetType GetRenderTargetType ()
 

Detailed Description

Definition at line 20 of file gpu_surface_metal_impeller_unittests.mm.

Constructor & Destructor Documentation

◆ TestGPUSurfaceMetalDelegate()

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

Definition at line 22 of file gpu_surface_metal_impeller_unittests.mm.

23 layer_ = [[CAMetalLayer alloc] init];
24 }
GPUSurfaceMetalDelegate(MTLRenderTargetType render_target)
Construct a new GPUSurfaceMetalDelegate object with the specified render_target type.

◆ ~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 39 of file gpu_surface_metal_impeller_unittests.mm.

39{ return true; }

◆ GetCAMetalLayer()

GPUCAMetalLayerHandle flutter::testing::TestGPUSurfaceMetalDelegate::GetCAMetalLayer ( const DlISize 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 28 of file gpu_surface_metal_impeller_unittests.mm.

28 {
29 layer_.drawableSize = CGSizeMake(frame_info.width, frame_info.height);
30 return (__bridge GPUCAMetalLayerHandle)(layer_);
31 }

References impeller::TSize< T >::height, and impeller::TSize< T >::width.

◆ GetMTLTexture()

GPUMTLTextureInfo flutter::testing::TestGPUSurfaceMetalDelegate::GetMTLTexture ( const DlISize 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 35 of file gpu_surface_metal_impeller_unittests.mm.

35{ 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
|GPUSurfaceMetalDelegateGetCAMetalLayer|

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 33 of file gpu_surface_metal_impeller_unittests.mm.

33{ 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
|GPUSurfaceMetalDelegateGetMTLTexture|

Implements flutter::GPUSurfaceMetalDelegate.

Definition at line 37 of file gpu_surface_metal_impeller_unittests.mm.

37{ return true; }

◆ SetDevice()

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

Definition at line 41 of file gpu_surface_metal_impeller_unittests.mm.

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

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