Flutter Engine
ios_switchable_gl_context.mm
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 #import "flutter/shell/platform/darwin/ios/ios_switchable_gl_context.h"
6 
7 #import <OpenGLES/EAGL.h>
8 
9 namespace flutter {
10 
11 IOSSwitchableGLContext::IOSSwitchableGLContext(EAGLContext* context) : context_(context){};
12 
15  FML_DCHECK(context_ != nullptr);
16  EAGLContext* current_context = EAGLContext.currentContext;
17  previous_context_ = current_context;
18  return [EAGLContext setCurrentContext:context_];
19 };
20 
23  return [EAGLContext setCurrentContext:previous_context_];
24 };
25 }
#define FML_DCHECK(condition)
Definition: logging.h:86
FML_THREAD_LOCAL fml::ThreadLocalUniquePtr< int > current_context
#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c)