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/flow/gl_context_switch.h"
6 
7 namespace flutter {
8 
10 
12 
14 
16 
17 GLContextResult::GLContextResult(bool static_result) : result_(static_result){};
18 
20  return result_;
21 };
22 
24  : GLContextResult(static_result){};
25 
27 
28 GLContextSwitch::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
GLContextSwitch(std::unique_ptr< SwitchableGLContext > context)
Definition: ref_ptr.h:252
GLContextDefaultResult(bool static_result)
#define FML_CHECK(condition)
Definition: logging.h:68