Flutter Engine
The Flutter Engine
embedder_surface_gl_impeller.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_EMBEDDER_EMBEDDER_SURFACE_GL_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_IMPELLER_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/shell/gpu/gpu_surface_gl_impeller.h"
10#include "flutter/shell/platform/embedder/embedder_external_view_embedder.h"
11#include "flutter/shell/platform/embedder/embedder_surface.h"
12#include "flutter/shell/platform/embedder/embedder_surface_gl_skia.h"
13
14namespace impeller {
15class ContextGLES;
16} // namespace impeller
17
18namespace flutter {
19
20class ReactorWorker;
21
24 public:
27 bool fbo_reset_after_present,
28 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder);
29
31
32 private:
33 bool valid_ = false;
35 bool fbo_reset_after_present_;
36 std::shared_ptr<impeller::ContextGLES> impeller_context_;
37 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
38 std::shared_ptr<ReactorWorker> worker_;
39
40 // |EmbedderSurface|
41 bool IsValid() const override;
42
43 // |EmbedderSurface|
44 std::unique_ptr<Surface> CreateGPUSurface() override;
45
46 // |EmbedderSurface|
47 std::shared_ptr<impeller::Context> CreateImpellerContext() const override;
48
49 // |GPUSurfaceGLDelegate|
50 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
51
52 // |GPUSurfaceGLDelegate|
53 bool GLContextClearCurrent() override;
54
55 // |GPUSurfaceGLDelegate|
56 bool GLContextPresent(const GLPresentInfo& present_info) override;
57
58 // |GPUSurfaceGLDelegate|
59 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
60
61 // |GPUSurfaceGLDelegate|
62 bool GLContextFBOResetAfterPresent() const override;
63
64 // |GPUSurfaceGLDelegate|
65 SkMatrix GLContextSurfaceTransformation() const override;
66
67 // |GPUSurfaceGLDelegate|
68 GLProcResolver GetGLProcResolver() const override;
69
70 // |GPUSurfaceGLDelegate|
71 SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const override;
72
73 // |EmbedderSurface|
74 sk_sp<GrDirectContext> CreateResourceContext() const override;
75
76 FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurfaceGLImpeller);
77};
78
79} // namespace flutter
80
81#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_IMPELLER_H_
EmbedderSurfaceGLImpeller(EmbedderSurfaceGLSkia::GLDispatchTable gl_dispatch_table, bool fbo_reset_after_present, std::shared_ptr< EmbedderExternalViewEmbedder > external_view_embedder)
std::function< void *(const char *)> GLProcResolver