Flutter Engine
The Flutter Engine
embedder_surface_gl_skia.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_SKIA_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_SKIA_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
26 std::function<void*(const char*)> gl_proc_resolver; // optional
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|
51 sk_sp<GrDirectContext> CreateResourceContext() const override;
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|
69 SkMatrix GLContextSurfaceTransformation() const override;
70
71 // |GPUSurfaceGLDelegate|
72 GLProcResolver GetGLProcResolver() const override;
73
74 // |GPUSurfaceGLDelegate|
75 SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const override;
76
77 FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurfaceGLSkia);
78};
79
80} // namespace flutter
81
82#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_SKIA_H_
EmbedderSurfaceGLSkia(GLDispatchTable gl_dispatch_table, bool fbo_reset_after_present, std::shared_ptr< EmbedderExternalViewEmbedder > external_view_embedder)
std::function< void *(const char *)> GLProcResolver
Dart_NativeFunction function
Definition: fuchsia.cc:51
std::function< GLFBOInfo(intptr_t)> gl_populate_existing_damage
std::function< intptr_t(GLFrameInfo)> gl_fbo_callback
std::function< bool(GLPresentInfo)> gl_present_callback
std::function< void *(const char *)> gl_proc_resolver
std::function< SkMatrix(void)> gl_surface_transformation_callback