Flutter Engine
ios_context_gl.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_SHELL_PLATFORM_DARWIN_IOS_IOS_GL_CONTEXT_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_GL_CONTEXT_H_
7 
8 #include "flutter/fml/macros.h"
9 #include "flutter/fml/platform/darwin/scoped_nsobject.h"
10 #include "flutter/shell/common/platform_view.h"
11 #import "flutter/shell/platform/darwin/ios/ios_context.h"
12 #import "flutter/shell/platform/darwin/ios/ios_context_gl.h"
13 #import "flutter/shell/platform/darwin/ios/ios_render_target_gl.h"
14 
15 @class CAEAGLLayer;
16 
17 namespace flutter {
18 
19 class IOSContextGL final : public IOSContext {
20  public:
21  IOSContextGL();
22 
23  // |IOSContext|
24  ~IOSContextGL() override;
25 
26  std::unique_ptr<IOSRenderTargetGL> CreateRenderTarget(fml::scoped_nsobject<CAEAGLLayer> layer);
27 
28  private:
30  fml::scoped_nsobject<EAGLContext> resource_context_;
31 
32  // |IOSContext|
33  sk_sp<GrDirectContext> CreateResourceContext() override;
34 
35  // |IOSContext|
36  std::unique_ptr<GLContextResult> MakeCurrent() override;
37 
38  // |IOSContext|
39  std::unique_ptr<Texture> CreateExternalTexture(
40  int64_t texture_id,
41  fml::scoped_nsobject<NSObject<FlutterTexture>> texture) override;
42 
43  FML_DISALLOW_COPY_AND_ASSIGN(IOSContextGL);
44 };
45 
46 } // namespace flutter
47 
48 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_GL_CONTEXT_H_
std::unique_ptr< IOSRenderTargetGL > CreateRenderTarget(fml::scoped_nsobject< CAEAGLLayer > layer)
~IOSContextGL() override
Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts ar...
Definition: ios_context.h:33