Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
context.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_LIB_GPU_CONTEXT_H_
6#define FLUTTER_LIB_GPU_CONTEXT_H_
7
8#include "dart_api.h"
12
13namespace flutter {
14namespace gpu {
15
17
18class Context : public RefCountedDartWrappable<Context> {
19 DEFINE_WRAPPERTYPEINFO();
21
22 public:
23 static void SetOverrideContext(std::shared_ptr<impeller::Context> context);
24
25 static std::shared_ptr<impeller::Context> GetOverrideContext();
26
27 static std::shared_ptr<impeller::Context> GetDefaultContext(
28 std::optional<std::string>& out_error);
29
30 explicit Context(std::shared_ptr<impeller::Context> context);
31 ~Context() override;
32
34
35 std::shared_ptr<impeller::Context>& GetContextShared();
36
37 private:
38 /// An Impeller context that takes precedent over the IO state context when
39 /// set. This is used to inject the context when running with the Impeller
40 /// playground, which doesn't instantiate an Engine instance.
41 static std::shared_ptr<impeller::Context> default_context_;
42
43 std::shared_ptr<impeller::Context> context_;
44
46};
47
48} // namespace gpu
49} // namespace flutter
50
51//----------------------------------------------------------------------------
52/// Exports
53///
54
55extern "C" {
56
59 Dart_Handle wrapper);
60
63 flutter::gpu::Context* wrapper);
64
67 flutter::gpu::Context* wrapper);
68
71 flutter::gpu::Context* wrapper);
72
75 flutter::gpu::Context* wrapper);
76
79 flutter::gpu::Context* wrapper);
80
83 flutter::gpu::Context* wrapper);
84
87 flutter::gpu::Context* wrapper);
88
91 flutter::gpu::Context* wrapper);
92
95 flutter::gpu::Context* wrapper,
96 int family);
97
100 flutter::gpu::Context* wrapper,
101 int format,
102 bool render_target,
103 bool shader_read,
104 bool shader_write);
105
106} // extern "C"
107
108#endif // FLUTTER_LIB_GPU_CONTEXT_H_
static std::shared_ptr< impeller::Context > GetOverrideContext()
Definition context.cc:35
static void SetOverrideContext(std::shared_ptr< impeller::Context > context)
Definition context.cc:31
std::shared_ptr< impeller::Context > & GetContextShared()
Definition context.cc:91
impeller::Context & GetContext()
Definition context.cc:87
static std::shared_ptr< impeller::Context > GetDefaultContext(std::optional< std::string > &out_error)
Definition context.cc:39
To do anything rendering related with Impeller, you need a context.
Definition context.h:69
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultDepthStencilFormat(flutter::gpu::Context *wrapper)
Definition context.cc:127
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Context_GetSupportsFramebufferRenderMipmap(flutter::gpu::Context *wrapper)
Definition context.cc:143
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_Context_InitializeDefault(Dart_Handle wrapper)
Definition context.cc:102
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Context_SupportsTextureFormat(flutter::gpu::Context *wrapper, int format, bool render_target, bool shader_read, bool shader_write)
Definition context.cc:164
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetBackendType(flutter::gpu::Context *wrapper)
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Context_GetSupportsManuallyMippedTextures(flutter::gpu::Context *wrapper)
Definition context.cc:150
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Context_SupportsTextureCompression(flutter::gpu::Context *wrapper, int family)
Definition context.cc:157
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Context_GetSupportsOffscreenMSAA(flutter::gpu::Context *wrapper)
Definition context.cc:138
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetMinimumUniformByteAlignment(flutter::gpu::Context *wrapper)
Definition context.cc:133
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultStencilFormat(flutter::gpu::Context *wrapper)
Definition context.cc:121
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultColorFormat(flutter::gpu::Context *wrapper)
Definition context.cc:115
#define FLUTTER_GPU_EXPORT
Definition export.h:13
bool SupportsNormalOffscreenMSAA(const impeller::Context &context)
Definition context.cc:21
#define FML_FRIEND_MAKE_REF_COUNTED(T)
std::shared_ptr< ContextGLES > context