 |
Flutter Impeller
|
|
Go to the documentation of this file.
10 #include "flutter/fml/logging.h"
11 #include "flutter/fml/macros.h"
12 #include "flutter/fml/mapping.h"
31 FML_CHECK(error == GL_NO_ERROR)
33 <<
" encountered on call to " <<
name;
45 const char*
name =
nullptr;
64 template <
class... Args>
66 #ifdef IMPELLER_ERROR_CHECK_ALL_GL_CALLS
68 #endif // IMPELLER_ERROR_CHECK_ALL_GL_CALLS
69 #ifdef IMPELLER_TRACE_ALL_GL_CALLS
70 TRACE_EVENT0(
"impeller",
name);
71 #endif // IMPELLER_TRACE_ALL_GL_CALLS
72 return function(std::forward<Args>(args)...);
75 constexpr
bool IsAvailable()
const {
return function !=
nullptr; }
84 #define FOR_EACH_IMPELLER_PROC(PROC) \
85 PROC(ActiveTexture); \
87 PROC(BindAttribLocation); \
89 PROC(BindFramebuffer); \
90 PROC(BindRenderbuffer); \
92 PROC(BlendEquationSeparate); \
93 PROC(BlendFuncSeparate); \
95 PROC(CheckFramebufferStatus); \
101 PROC(CompileShader); \
102 PROC(CreateProgram); \
103 PROC(CreateShader); \
105 PROC(DeleteBuffers); \
106 PROC(DeleteFramebuffers); \
107 PROC(DeleteProgram); \
108 PROC(DeleteRenderbuffers); \
109 PROC(DeleteShader); \
110 PROC(DeleteTextures); \
114 PROC(DetachShader); \
116 PROC(DisableVertexAttribArray); \
118 PROC(DrawElements); \
120 PROC(EnableVertexAttribArray); \
122 PROC(FramebufferRenderbuffer); \
123 PROC(FramebufferTexture2D); \
126 PROC(GenerateMipmap); \
127 PROC(GenFramebuffers); \
128 PROC(GenRenderbuffers); \
130 PROC(GetActiveUniform); \
133 PROC(GetFramebufferAttachmentParameteriv); \
135 PROC(GetProgramInfoLog); \
136 PROC(GetProgramiv); \
137 PROC(GetShaderInfoLog); \
141 PROC(GetUniformLocation); \
143 PROC(IsFramebuffer); \
145 PROC(IsRenderbuffer); \
149 PROC(RenderbufferStorage); \
151 PROC(ShaderBinary); \
152 PROC(ShaderSource); \
153 PROC(StencilFuncSeparate); \
154 PROC(StencilMaskSeparate); \
155 PROC(StencilOpSeparate); \
157 PROC(TexParameteri); \
163 PROC(UniformMatrix4fv); \
165 PROC(VertexAttribPointer); \
169 #define FOR_EACH_IMPELLER_GLES3_PROC(PROC) PROC(BlitFramebuffer);
171 #define FOR_EACH_IMPELLER_EXT_PROC(PROC) \
172 PROC(DiscardFramebufferEXT); \
173 PROC(FramebufferTexture2DMultisampleEXT) \
174 PROC(PushDebugGroupKHR); \
175 PROC(PopDebugGroupKHR); \
176 PROC(ObjectLabelKHR); \
177 PROC(RenderbufferStorageMultisampleEXT);
190 using Resolver = std::function<
void*(
const char* function_name)>;
195 #define IMPELLER_PROC(name) \
196 GLProc<decltype(gl##name)> name = {"gl" #name, nullptr};
220 const std::string& label)
const;
227 bool is_valid_ =
false;
228 std::unique_ptr<DescriptionGLES> description_;
229 std::unique_ptr<CapabilitiesGLES> capabilities_;
230 GLint debug_label_max_length_ = 0;
FOR_EACH_IMPELLER_PROC(IMPELLER_PROC)
ProcTableGLES(Resolver resolver)
#define IMPELLER_PROC(name)
FOR_EACH_IMPELLER_GLES3_PROC(IMPELLER_PROC)
void PushDebugGroup(const std::string &string) const
AutoErrorCheck(PFNGLGETERRORPROC error, const char *name)
constexpr bool IsAvailable() const
bool SetDebugLabel(DebugResourceType type, GLint name, const std::string &label) const
FOR_EACH_IMPELLER_EXT_PROC(IMPELLER_PROC)
std::function< void *(const char *function_name)> Resolver
PFNGLGETERRORPROC error_fn
std::string GetProgramInfoLogString(GLuint program) const
std::string DescribeCurrentFramebuffer() const
auto operator()(Args &&... args) const
Call the GL function with the appropriate parameters. Lookup the documentation for the GL function be...
bool IsCurrentFramebufferComplete() const
const char * GLErrorToString(GLenum value)
const PFNGLGETERRORPROC error_fn
const CapabilitiesGLES * GetCapabilities() const
void ShaderSourceMapping(GLuint shader, const fml::Mapping &mapping) const
void PopDebugGroup() const
const DescriptionGLES * GetDescription() const