Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
 
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 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.
 
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 ()
 
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.
init(device_serial, adb_binary)
Definition _adb_path.py:12

◆ ~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
|GPUSurfaceMetalDelegateGetCAMetalLayer|

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

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: