Flutter Engine
flutter::AndroidSurfaceMock Class Referencefinal

#include <android_surface_mock.h>

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

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 (uint32_t fbo_id) override
 
intptr_t GLContextFBO (GLFrameInfo frame_info) const override
 
ExternalViewEmbedderGetExternalViewEmbedder () override
 Gets the view embedder that controls how the Flutter layer hierarchy split into multiple chunks should be composited back on-screen. This field is optional and the Flutter rasterizer will render into a single on-screen surface if this call returns a null external view embedder. This happens on the GPU thread. More...
 
- Public Member Functions inherited from flutter::GPUSurfaceGLDelegate
 ~GPUSurfaceGLDelegate () override
 
virtual bool GLContextFBOResetAfterPresent () const
 
virtual bool SurfaceSupportsReadback () const
 
virtual SkMatrix GLContextSurfaceTransformation () const
 
virtual sk_sp< const GrGLInterface > GetGLInterface () const
 
virtual GLProcResolver GetGLProcResolver () const
 
- Public Member Functions inherited from flutter::GPUSurfaceDelegate
virtual ~GPUSurfaceDelegate ()
 
- 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
 

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 GrGLInterface > GetDefaultPlatformGLInterface ()
 

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

◆ GetExternalViewEmbedder()

ExternalViewEmbedder * flutter::AndroidSurfaceMock::GetExternalViewEmbedder ( )
overridevirtual

Gets the view embedder that controls how the Flutter layer hierarchy split into multiple chunks should be composited back on-screen. This field is optional and the Flutter rasterizer will render into a single on-screen surface if this call returns a null external view embedder. This happens on the GPU thread.

Returns
The external view embedder, or, null if Flutter is rendering into a single on-screen surface.

Reimplemented from flutter::GPUSurfaceGLDelegate.

Definition at line 25 of file android_surface_mock.cc.

25  {
26  return nullptr;
27 }

◆ 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()

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

Implements flutter::GPUSurfaceGLDelegate.

Definition at line 21 of file android_surface_mock.cc.

21  {
22  return 0;
23 }

◆ 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 ( uint32_t  fbo_id)
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 ( void  ,
TeardownOnScreenContext  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [3/7]

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

◆ MOCK_METHOD() [4/7]

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

◆ MOCK_METHOD() [5/7]

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

◆ MOCK_METHOD() [6/7]

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

◆ MOCK_METHOD() [7/7]

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

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