Flutter Engine
The Flutter Engine
gpu_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_GPU_GPU_SURFACE_GL_IMPELLER_H_
6#define FLUTTER_SHELL_GPU_GPU_SURFACE_GL_IMPELLER_H_
7
8#include "flutter/common/graphics/gl_context_switch.h"
9#include "flutter/flow/surface.h"
10#include "flutter/fml/macros.h"
11#include "flutter/fml/memory/weak_ptr.h"
12#include "flutter/impeller/aiks/aiks_context.h"
13#include "flutter/impeller/renderer/context.h"
14#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
16
17namespace flutter {
18
19class GPUSurfaceGLImpeller final : public Surface {
20 public:
22 std::shared_ptr<impeller::Context> context,
23 bool render_to_surface);
24
25 // |Surface|
27
28 // |Surface|
29 bool IsValid() override;
30
31 private:
32 GPUSurfaceGLDelegate* delegate_ = nullptr;
33 std::shared_ptr<impeller::Context> impeller_context_;
34 bool render_to_surface_ = true;
35 std::shared_ptr<impeller::Renderer> impeller_renderer_;
36 std::shared_ptr<impeller::AiksContext> aiks_context_;
37 bool is_valid_ = false;
39
40 // |Surface|
41 std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) override;
42
43 // |Surface|
44 SkMatrix GetRootTransformation() const override;
45
46 // |Surface|
47 GrDirectContext* GetContext() override;
48
49 // |Surface|
50 std::unique_ptr<GLContextResult> MakeRenderContextCurrent() override;
51
52 // |Surface|
53 bool ClearRenderContext() override;
54
55 // |Surface|
56 bool AllowsDrawingWhenGpuDisabled() const override;
57
58 // |Surface|
59 bool EnableRasterCache() const override;
60
61 // |Surface|
62 std::shared_ptr<impeller::AiksContext> GetAiksContext() const override;
63
64 FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceGLImpeller);
65};
66
67} // namespace flutter
68
69#endif // FLUTTER_SHELL_GPU_GPU_SURFACE_GL_IMPELLER_H_
GPUSurfaceGLImpeller(GPUSurfaceGLDelegate *delegate, std::shared_ptr< impeller::Context > context, bool render_to_surface)
Abstract Base Class that represents where we will be rendering content.
Definition: surface.h:24
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkSize.h:16