Flutter Engine
ios_surface_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_SURFACE_GL_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_
7 
8 #include "flutter/fml/macros.h"
9 #include "flutter/fml/platform/darwin/scoped_nsobject.h"
10 #include "flutter/shell/gpu/gpu_surface_gl.h"
11 #import "flutter/shell/platform/darwin/ios/ios_context.h"
12 #import "flutter/shell/platform/darwin/ios/ios_render_target_gl.h"
13 #import "flutter/shell/platform/darwin/ios/ios_surface.h"
14 
15 @class CAEAGLLayer;
16 
17 namespace flutter {
18 
19 class IOSSurfaceGL final : public IOSSurface, public GPUSurfaceGLDelegate {
20  public:
23  std::shared_ptr<IOSContext> context,
24  const std::shared_ptr<FlutterPlatformViewsController>& platform_views_controller = nullptr);
25 
26  ~IOSSurfaceGL() override;
27 
28  // |IOSSurface|
29  bool IsValid() const override;
30 
31  // |IOSSurface|
32  void UpdateStorageSizeIfNecessary() override;
33 
34  // |IOSSurface|
35  std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
36 
37  // |GPUSurfaceGLDelegate|
38  std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
39 
40  // |GPUSurfaceGLDelegate|
41  bool GLContextClearCurrent() override;
42 
43  // |GPUSurfaceGLDelegate|
44  bool GLContextPresent(uint32_t fbo_id) override;
45 
46  // |GPUSurfaceGLDelegate|
47  intptr_t GLContextFBO(GLFrameInfo frame_info) const override;
48 
49  // |GPUSurfaceGLDelegate|
50  bool SurfaceSupportsReadback() const override;
51 
52  // |GPUSurfaceGLDelegate|
54 
55  private:
56  std::unique_ptr<IOSRenderTargetGL> render_target_;
57 
58  FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceGL);
59 };
60 
61 } // namespace flutter
62 
63 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_
bool GLContextPresent(uint32_t fbo_id) override
~IOSSurfaceGL() override
ExternalViewEmbedder * GetExternalViewEmbedder() override
Gets the view embedder that controls how the Flutter layer hierarchy split into multiple chunks shoul...
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override
IOSSurfaceGL(fml::scoped_nsobject< CAEAGLLayer > layer, std::shared_ptr< IOSContext > context, const std::shared_ptr< FlutterPlatformViewsController > &platform_views_controller=nullptr)
bool SurfaceSupportsReadback() const override
intptr_t GLContextFBO(GLFrameInfo frame_info) const override
bool GLContextClearCurrent() override
std::unique_ptr< GLContextResult > GLContextMakeCurrent() override
void UpdateStorageSizeIfNecessary() override
bool IsValid() const override