Flutter Engine
The Flutter Engine
gl_context_switch_test.h
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#ifndef FLUTTER_FLOW_TESTING_GL_CONTEXT_SWITCH_TEST_H_
6#define FLUTTER_FLOW_TESTING_GL_CONTEXT_SWITCH_TEST_H_
7
8#include "flutter/common/graphics/gl_context_switch.h"
9#include "gtest/gtest.h"
10
11namespace flutter {
12namespace testing {
13
14//------------------------------------------------------------------------------
15/// The renderer context used for testing
17 public:
18 explicit TestSwitchableGLContext(int context);
19
21
22 bool SetCurrent() override;
23
24 bool RemoveCurrent() override;
25
26 int GetContext();
27
28 static int GetCurrentContext();
29
30 //------------------------------------------------------------------------------
31 /// Set the current context
32 ///
33 /// This is to mimic how other programs outside flutter sets the context.
34 static void SetCurrentContext(int context);
35
36 private:
37 int context_;
38
39 FML_DISALLOW_COPY_AND_ASSIGN(TestSwitchableGLContext);
40};
41
42} // namespace testing
43} // namespace flutter
44
45#endif // FLUTTER_FLOW_TESTING_GL_CONTEXT_SWITCH_TEST_H_
The renderer context used for testing.