Flutter Engine
The Flutter Engine
flow
testing
gl_context_switch_test.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
gl_context_switch_test.h
"
6
7
namespace
flutter
{
8
namespace
testing {
9
10
static
thread_local
std::unique_ptr<int>
current_context
;
11
12
TestSwitchableGLContext::TestSwitchableGLContext
(
int
context)
13
: context_(context){};
14
15
TestSwitchableGLContext::~TestSwitchableGLContext
() =
default
;
16
17
bool
TestSwitchableGLContext::SetCurrent
() {
18
SetCurrentContext
(context_);
19
return
true
;
20
};
21
22
bool
TestSwitchableGLContext::RemoveCurrent
() {
23
SetCurrentContext
(-1);
24
return
true
;
25
};
26
27
int
TestSwitchableGLContext::GetContext
() {
28
return
context_;
29
};
30
31
int
TestSwitchableGLContext::GetCurrentContext
() {
32
return
*(
current_context
.get());
33
};
34
35
void
TestSwitchableGLContext::SetCurrentContext
(
int
context) {
36
current_context
.reset(
new
int
(context));
37
};
38
}
// namespace testing
39
}
// namespace flutter
flutter::testing::TestSwitchableGLContext::SetCurrent
bool SetCurrent() override
Definition:
gl_context_switch_test.cc:17
flutter::testing::TestSwitchableGLContext::TestSwitchableGLContext
TestSwitchableGLContext(int context)
Definition:
gl_context_switch_test.cc:12
flutter::testing::TestSwitchableGLContext::GetContext
int GetContext()
Definition:
gl_context_switch_test.cc:27
flutter::testing::TestSwitchableGLContext::GetCurrentContext
static int GetCurrentContext()
Definition:
gl_context_switch_test.cc:31
flutter::testing::TestSwitchableGLContext::SetCurrentContext
static void SetCurrentContext(int context)
Definition:
gl_context_switch_test.cc:35
flutter::testing::TestSwitchableGLContext::RemoveCurrent
bool RemoveCurrent() override
Definition:
gl_context_switch_test.cc:22
flutter::testing::TestSwitchableGLContext::~TestSwitchableGLContext
~TestSwitchableGLContext() override
gl_context_switch_test.h
flutter::testing::current_context
static thread_local std::unique_ptr< int > current_context
Definition:
gl_context_switch_test.cc:10
flutter
Definition:
asset_manager.cc:10
Generated on Sun Jun 23 2024 21:54:57 for Flutter Engine by
1.9.4