Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
flutter::TestMetalSurface Class Reference

Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests. More...

#include <test_metal_surface.h>

Inheritance diagram for flutter::TestMetalSurface:
flutter::TestMetalSurfaceImpl

Public Member Functions

virtual ~TestMetalSurface ()
 
virtual bool IsValid () const
 
virtual sk_sp< GrDirectContextGetGrContext () const
 
virtual sk_sp< SkSurfaceGetSurface () const
 
virtual sk_sp< SkImageGetRasterSurfaceSnapshot ()
 
virtual TestMetalContext::TextureInfo GetTextureInfo ()
 

Static Public Member Functions

static bool PlatformSupportsMetal ()
 
static std::unique_ptr< TestMetalSurfaceCreate (const TestMetalContext &test_metal_context, SkISize surface_size=SkISize::MakeEmpty())
 
static std::unique_ptr< TestMetalSurfaceCreate (const TestMetalContext &test_metal_context, int64_t texture_id, SkISize surface_size=SkISize::MakeEmpty())
 

Protected Member Functions

 TestMetalSurface ()
 

Detailed Description

Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests.

Definition at line 20 of file test_metal_surface.h.

Constructor & Destructor Documentation

◆ ~TestMetalSurface()

flutter::TestMetalSurface::~TestMetalSurface ( )
virtualdefault

◆ TestMetalSurface()

flutter::TestMetalSurface::TestMetalSurface ( )
protecteddefault

Member Function Documentation

◆ Create() [1/2]

std::unique_ptr< TestMetalSurface > flutter::TestMetalSurface::Create ( const TestMetalContext test_metal_context,
int64_t  texture_id,
SkISize  surface_size = SkISize::MakeEmpty() 
)
static

Definition at line 25 of file test_metal_surface.cc.

28 {
29 return std::make_unique<TestMetalSurfaceImpl>(test_metal_context, texture_id,
30 surface_size);
31}
int64_t texture_id

◆ Create() [2/2]

std::unique_ptr< TestMetalSurface > flutter::TestMetalSurface::Create ( const TestMetalContext test_metal_context,
SkISize  surface_size = SkISize::MakeEmpty() 
)
static

Definition at line 18 of file test_metal_surface.cc.

20 {
21 return std::make_unique<TestMetalSurfaceImpl>(test_metal_context,
22 surface_size);
23}

◆ GetGrContext()

sk_sp< GrDirectContext > flutter::TestMetalSurface::GetGrContext ( ) const
virtual

Reimplemented in flutter::TestMetalSurfaceImpl.

Definition at line 41 of file test_metal_surface.cc.

41 {
42 return impl_ ? impl_->GetGrContext() : nullptr;
43}

◆ GetRasterSurfaceSnapshot()

sk_sp< SkImage > flutter::TestMetalSurface::GetRasterSurfaceSnapshot ( )
virtual

Reimplemented in flutter::TestMetalSurfaceImpl.

Definition at line 49 of file test_metal_surface.cc.

49 {
50 return impl_ ? impl_->GetRasterSurfaceSnapshot() : nullptr;
51}

◆ GetSurface()

sk_sp< SkSurface > flutter::TestMetalSurface::GetSurface ( ) const
virtual

Reimplemented in flutter::TestMetalSurfaceImpl.

Definition at line 45 of file test_metal_surface.cc.

45 {
46 return impl_ ? impl_->GetSurface() : nullptr;
47}

◆ GetTextureInfo()

TestMetalContext::TextureInfo flutter::TestMetalSurface::GetTextureInfo ( )
virtual

Reimplemented in flutter::TestMetalSurfaceImpl.

Definition at line 53 of file test_metal_surface.cc.

53 {
54 return impl_ ? impl_->GetTextureInfo() : TestMetalContext::TextureInfo();
55}

◆ IsValid()

bool flutter::TestMetalSurface::IsValid ( ) const
virtual

Reimplemented in flutter::TestMetalSurfaceImpl.

Definition at line 37 of file test_metal_surface.cc.

37 {
38 return impl_ ? impl_->IsValid() : false;
39}

◆ PlatformSupportsMetal()

bool flutter::TestMetalSurface::PlatformSupportsMetal ( )
static

Definition at line 14 of file test_metal_surface.cc.

14 {
15 return true;
16}

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