Flutter Engine
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< GrDirectContext > GetGrContext () const
 
virtual sk_sp< SkSurface > GetSurface () const
 

Static Public Member Functions

static bool PlatformSupportsMetal ()
 
static std::unique_ptr< TestMetalSurfaceCreate (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 19 of file test_metal_surface.h.

Constructor & Destructor Documentation

◆ ~TestMetalSurface()

flutter::TestMetalSurface::~TestMetalSurface ( )
virtualdefault

Referenced by Create().

◆ TestMetalSurface()

flutter::TestMetalSurface::TestMetalSurface ( )
protecteddefault

Referenced by Create().

Member Function Documentation

◆ Create()

std::unique_ptr< TestMetalSurface > flutter::TestMetalSurface::Create ( SkISize  surface_size = SkISize::MakeEmpty())
static

Definition at line 21 of file test_metal_surface.cc.

References TestMetalSurface(), and ~TestMetalSurface().

Referenced by flutter::testing::TEST().

22  {
23 #if TESTING_ENABLE_METAL
24  return std::make_unique<TestMetalSurfaceImpl>(surface_size);
25 #else // TESTING_ENABLE_METAL
26  return nullptr;
27 #endif // TESTING_ENABLE_METAL
28 }

◆ GetGrContext()

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

Definition at line 38 of file test_metal_surface.cc.

38  {
39  return impl_ ? impl_->GetGrContext() : nullptr;
40 }

◆ GetSurface()

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

Definition at line 42 of file test_metal_surface.cc.

42  {
43  return impl_ ? impl_->GetSurface() : nullptr;
44 }

◆ IsValid()

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

Definition at line 34 of file test_metal_surface.cc.

34  {
35  return impl_ ? impl_->IsValid() : false;
36 }

◆ PlatformSupportsMetal()

bool flutter::TestMetalSurface::PlatformSupportsMetal ( )
static

Definition at line 13 of file test_metal_surface.cc.

Referenced by flutter::testing::TEST().

13  {
14 #if TESTING_ENABLE_METAL
15  return true;
16 #else // TESTING_ENABLE_METAL
17  return false;
18 #endif // TESTING_ENABLE_METAL
19 }

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