Flutter Engine
The Flutter Engine
gl_context_switch.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 "flutter/common/graphics/gl_context_switch.h"
6
7namespace flutter {
8
10
12
14
16
17GLContextResult::GLContextResult(bool static_result) : result_(static_result){};
18
20 return result_;
21};
22
24 : GLContextResult(static_result){};
25
27
28GLContextSwitch::GLContextSwitch(std::unique_ptr<SwitchableGLContext> context)
29 : context_(std::move(context)) {
30 FML_CHECK(context_ != nullptr);
31 result_ = context_->SetCurrent();
32};
33
35 context_->RemoveCurrent();
36};
37
38} // namespace flutter
GLContextDefaultResult(bool static_result)
GLContextSwitch(std::unique_ptr< SwitchableGLContext > context)
#define FML_CHECK(condition)
Definition: logging.h:85
Definition: ref_ptr.h:256