Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
embedder_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_EMBEDDER_EMBEDDER_SURFACE_GL_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/shell/gpu/gpu_surface_gl_skia.h"
10#include "flutter/shell/platform/embedder/embedder_external_view_embedder.h"
11#include "flutter/shell/platform/embedder/embedder_surface.h"
12
13namespace flutter {
14
17 public:
19 std::function<bool(void)> gl_make_current_callback; // required
20 std::function<bool(void)> gl_clear_current_callback; // required
21 std::function<bool(GLPresentInfo)> gl_present_callback; // required
22 std::function<intptr_t(GLFrameInfo)> gl_fbo_callback; // required
23 std::function<bool(void)> gl_make_resource_current_callback; // optional
24 std::function<SkMatrix(void)>
26 std::function<void*(const char*)> gl_proc_resolver; // optional
27 std::function<GLFBOInfo(intptr_t)> gl_populate_existing_damage; // required
28 };
29
31 GLDispatchTable gl_dispatch_table,
32 bool fbo_reset_after_present,
33 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder);
34
36
37 private:
38 bool valid_ = false;
39 GLDispatchTable gl_dispatch_table_;
40 bool fbo_reset_after_present_;
41
42 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
43
44 // |EmbedderSurface|
45 bool IsValid() const override;
46
47 // |EmbedderSurface|
48 std::unique_ptr<Surface> CreateGPUSurface() override;
49
50 // |EmbedderSurface|
52
53 // |GPUSurfaceGLDelegate|
54 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
55
56 // |GPUSurfaceGLDelegate|
57 bool GLContextClearCurrent() override;
58
59 // |GPUSurfaceGLDelegate|
60 bool GLContextPresent(const GLPresentInfo& present_info) override;
61
62 // |GPUSurfaceGLDelegate|
63 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
64
65 // |GPUSurfaceGLDelegate|
66 bool GLContextFBOResetAfterPresent() const override;
67
68 // |GPUSurfaceGLDelegate|
70
71 // |GPUSurfaceGLDelegate|
72 GLProcResolver GetGLProcResolver() const override;
73
74 // |GPUSurfaceGLDelegate|
76
78};
79
80} // namespace flutter
81
82#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_H_
GLProcResolver GetGLProcResolver() const override
bool GLContextPresent(const GLPresentInfo &present_info) override
SkMatrix GLContextSurfaceTransformation() const override
GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override
std::unique_ptr< GLContextResult > GLContextMakeCurrent() override
sk_sp< GrDirectContext > CreateResourceContext() const override
bool IsValid() const override
SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const override
bool GLContextFBOResetAfterPresent() const override
std::unique_ptr< Surface > CreateGPUSurface() override
std::function< void *(const char *)> GLProcResolver
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
std::function< bool(GLPresentInfo)> gl_present_callback
std::function< bool(void)> gl_clear_current_callback
std::function< void *(const char *)> gl_proc_resolver
std::function< bool(void)> gl_make_resource_current_callback
std::function< bool(void)> gl_make_current_callback
std::function< intptr_t(GLFrameInfo)> gl_fbo_callback
std::function< SkMatrix(void)> gl_surface_transformation_callback
std::function< GLFBOInfo(intptr_t)> gl_populate_existing_damage