Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::AndroidSurfaceMock Class Referencefinal

#include <android_surface_mock.h>

Inheritance diagram for flutter::AndroidSurfaceMock:
flutter::GPUSurfaceGLDelegate flutter::AndroidSurface

Public Member Functions

 MOCK_METHOD (bool, IsValid,(),(const, override))
 
 MOCK_METHOD (void, TeardownOnScreenContext,(),(override))
 
 MOCK_METHOD (std::unique_ptr< Surface >, CreateGPUSurface,(GrDirectContext *gr_context),(override))
 
 MOCK_METHOD (bool, OnScreenSurfaceResize,(const SkISize &size),(override))
 
 MOCK_METHOD (bool, ResourceContextMakeCurrent,(),(override))
 
 MOCK_METHOD (bool, ResourceContextClearCurrent,(),(override))
 
 MOCK_METHOD (bool, SetNativeWindow,(fml::RefPtr< AndroidNativeWindow > window),(override))
 
std::unique_ptr< GLContextResultGLContextMakeCurrent () override
 
bool GLContextClearCurrent () override
 
bool GLContextPresent (const GLPresentInfo &present_info) override
 
GLFBOInfo GLContextFBO (GLFrameInfo frame_info) const override
 
- Public Member Functions inherited from flutter::GPUSurfaceGLDelegate
 ~GPUSurfaceGLDelegate ()
 
virtual std::unique_ptr< GLContextResultGLContextMakeCurrent ()=0
 
virtual bool GLContextClearCurrent ()=0
 
virtual void GLContextSetDamageRegion (const std::optional< SkIRect > &region)
 
virtual bool GLContextPresent (const GLPresentInfo &present_info)=0
 
virtual GLFBOInfo GLContextFBO (GLFrameInfo frame_info) const =0
 
virtual bool GLContextFBOResetAfterPresent () const
 
virtual SurfaceFrame::FramebufferInfo GLContextFramebufferInfo () const
 
virtual SkMatrix GLContextSurfaceTransformation () const
 
virtual sk_sp< const GrGLInterfaceGetGLInterface () const
 
virtual GLProcResolver GetGLProcResolver () const
 
virtual bool AllowsDrawingWhenGpuDisabled () const
 
- Public Member Functions inherited from flutter::AndroidSurface
virtual ~AndroidSurface ()
 
virtual bool IsValid () const =0
 
virtual void TeardownOnScreenContext ()=0
 
virtual std::unique_ptr< SurfaceCreateGPUSurface (GrDirectContext *gr_context=nullptr)=0
 
virtual bool OnScreenSurfaceResize (const SkISize &size)=0
 
virtual bool ResourceContextMakeCurrent ()=0
 
virtual bool ResourceContextClearCurrent ()=0
 
virtual bool SetNativeWindow (fml::RefPtr< AndroidNativeWindow > window)=0
 
virtual std::unique_ptr< SurfaceCreateSnapshotSurface ()
 
virtual std::shared_ptr< impeller::ContextGetImpellerContext ()
 

Additional Inherited Members

- Public Types inherited from flutter::GPUSurfaceGLDelegate
using GLProcResolver = std::function< void *(const char *)>
 
- Static Public Member Functions inherited from flutter::GPUSurfaceGLDelegate
static sk_sp< const GrGLInterfaceGetDefaultPlatformGLInterface ()
 
- Protected Member Functions inherited from flutter::AndroidSurface
 AndroidSurface ()
 

Detailed Description

Mock for |AndroidSurface|. This implementation can be used in unit tests without requiring the Android toolchain.

Definition at line 18 of file android_surface_mock.h.

Member Function Documentation

◆ GLContextClearCurrent()

bool flutter::AndroidSurfaceMock::GLContextClearCurrent ( )
overridevirtual

Implements flutter::GPUSurfaceGLDelegate.

Definition at line 13 of file android_surface_mock.cc.

13 {
14 return true;
15}

◆ GLContextFBO()

GLFBOInfo flutter::AndroidSurfaceMock::GLContextFBO ( GLFrameInfo  frame_info) const
overridevirtual

Implements flutter::GPUSurfaceGLDelegate.

Definition at line 21 of file android_surface_mock.cc.

21 {
22 return GLFBOInfo{
23 .fbo_id = 0,
24 };
25}

◆ GLContextMakeCurrent()

std::unique_ptr< GLContextResult > flutter::AndroidSurfaceMock::GLContextMakeCurrent ( )
overridevirtual

Implements flutter::GPUSurfaceGLDelegate.

Definition at line 9 of file android_surface_mock.cc.

9 {
10 return std::make_unique<GLContextDefaultResult>(/*static_result=*/true);
11}

◆ GLContextPresent()

bool flutter::AndroidSurfaceMock::GLContextPresent ( const GLPresentInfo present_info)
overridevirtual

Implements flutter::GPUSurfaceGLDelegate.

Definition at line 17 of file android_surface_mock.cc.

17 {
18 return true;
19}

◆ MOCK_METHOD() [1/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( bool  ,
IsValid  ,
()  ,
(const, override)   
)

◆ MOCK_METHOD() [2/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( bool  ,
OnScreenSurfaceResize  ,
(const SkISize &size ,
(override)   
)

◆ MOCK_METHOD() [3/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( bool  ,
ResourceContextClearCurrent  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [4/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( bool  ,
ResourceContextMakeCurrent  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [5/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( bool  ,
SetNativeWindow  ,
(fml::RefPtr< AndroidNativeWindow > window ,
(override)   
)

◆ MOCK_METHOD() [6/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( std::unique_ptr< Surface ,
CreateGPUSurface  ,
(GrDirectContext *gr_context)  ,
(override)   
)

◆ MOCK_METHOD() [7/7]

flutter::AndroidSurfaceMock::MOCK_METHOD ( void  ,
TeardownOnScreenContext  ,
()  ,
(override)   
)

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