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

The renderer context used for testing. More...

#include <gl_context_switch_test.h>

Inheritance diagram for flutter::testing::TestSwitchableGLContext:
flutter::SwitchableGLContext

Public Member Functions

 TestSwitchableGLContext (int context)
 
 ~TestSwitchableGLContext () override
 
bool SetCurrent () override
 
bool RemoveCurrent () override
 
int GetContext ()
 
- Public Member Functions inherited from flutter::SwitchableGLContext
 SwitchableGLContext ()
 
virtual ~SwitchableGLContext ()
 
 FML_DISALLOW_COPY_AND_ASSIGN (SwitchableGLContext)
 

Static Public Member Functions

static int GetCurrentContext ()
 
static void SetCurrentContext (int context)
 

Detailed Description

The renderer context used for testing.

Definition at line 16 of file gl_context_switch_test.h.

Constructor & Destructor Documentation

◆ TestSwitchableGLContext()

flutter::testing::TestSwitchableGLContext::TestSwitchableGLContext ( int  context)
explicit

Definition at line 12 of file gl_context_switch_test.cc.

13 : context_(context){};

◆ ~TestSwitchableGLContext()

flutter::testing::TestSwitchableGLContext::~TestSwitchableGLContext ( )
overridedefault

Member Function Documentation

◆ GetContext()

int flutter::testing::TestSwitchableGLContext::GetContext ( )

Definition at line 27 of file gl_context_switch_test.cc.

27 {
28 return context_;
29};

◆ GetCurrentContext()

int flutter::testing::TestSwitchableGLContext::GetCurrentContext ( )
static

Definition at line 31 of file gl_context_switch_test.cc.

31 {
32 return *(current_context.get());
33};
static thread_local std::unique_ptr< int > current_context

◆ RemoveCurrent()

bool flutter::testing::TestSwitchableGLContext::RemoveCurrent ( )
overridevirtual

Implements flutter::SwitchableGLContext.

Definition at line 22 of file gl_context_switch_test.cc.

22 {
24 return true;
25};

◆ SetCurrent()

bool flutter::testing::TestSwitchableGLContext::SetCurrent ( )
overridevirtual

Implements flutter::SwitchableGLContext.

Definition at line 17 of file gl_context_switch_test.cc.

17 {
18 SetCurrentContext(context_);
19 return true;
20};

◆ SetCurrentContext()

void flutter::testing::TestSwitchableGLContext::SetCurrentContext ( int  context)
static

Set the current context

This is to mimic how other programs outside flutter sets the context.

Definition at line 35 of file gl_context_switch_test.cc.

35 {
36 current_context.reset(new int(context));
37};

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