Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::GLProc< T > Struct Template Reference

#include <proc_table_gles.h>

Public Types

using GLFunctionType = T
 

Public Member Functions

template<class... Args>
auto operator() (Args &&... args) const
 Call the GL function with the appropriate parameters. Lookup the documentation for the GL function being called to understand the arguments and return types. The arguments types must match and will be type checked.
 
constexpr bool IsAvailable () const
 
void Reset ()
 

Public Attributes

std::string_view name = {}
 
GLFunctionTypefunction = nullptr
 
PFNGLGETERRORPROC error_fn = nullptr
 
bool log_calls = false
 

Detailed Description

template<class T>
struct impeller::GLProc< T >

Definition at line 80 of file proc_table_gles.h.

Member Typedef Documentation

◆ GLFunctionType

template<class T >
using impeller::GLProc< T >::GLFunctionType = T

Definition at line 81 of file proc_table_gles.h.

Member Function Documentation

◆ IsAvailable()

template<class T >
constexpr bool impeller::GLProc< T >::IsAvailable ( ) const
inlineconstexpr

Definition at line 129 of file proc_table_gles.h.

129{ return function != nullptr; }
GLFunctionType * function

References impeller::GLProc< T >::function.

Referenced by impeller::GLProc< T >::operator()().

◆ operator()()

template<class T >
template<class... Args>
auto impeller::GLProc< T >::operator() ( Args &&...  args) const
inline

Call the GL function with the appropriate parameters. Lookup the documentation for the GL function being called to understand the arguments and return types. The arguments types must match and will be type checked.

Definition at line 114 of file proc_table_gles.h.

114 {
115#if defined(IMPELLER_DEBUG) && !defined(NDEBUG)
116 AutoErrorCheck error(error_fn, name);
117 // We check for the existence of extensions, and reset the function pointer
118 // but it's still called unconditionally below, and will segfault. This
119 // validation log will at least give us a hint as to what's going on.
120 FML_CHECK(IsAvailable()) << "GL function " << name << " is not available. "
121 << "This is likely due to a missing extension.";
122 if (log_calls) {
124 }
125#endif // defined(IMPELLER_DEBUG) && !defined(NDEBUG)
126 return function(std::forward<Args>(args)...);
127 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
Definition logging.h:101
#define FML_CHECK(condition)
Definition logging.h:104
std::string BuildGLArguments(Type... args)
constexpr bool IsAvailable() const
std::string_view name
PFNGLGETERRORPROC error_fn

References args, impeller::BuildGLArguments(), error, impeller::GLProc< T >::error_fn, FML_CHECK, FML_LOG, impeller::GLProc< T >::function, impeller::GLProc< T >::IsAvailable(), impeller::GLProc< T >::log_calls, and impeller::GLProc< T >::name.

◆ Reset()

template<class T >
void impeller::GLProc< T >::Reset ( )
inline

Definition at line 131 of file proc_table_gles.h.

131 {
132 function = nullptr;
133 error_fn = nullptr;
134 }

References impeller::GLProc< T >::error_fn, and impeller::GLProc< T >::function.

Member Data Documentation

◆ error_fn

template<class T >
PFNGLGETERRORPROC impeller::GLProc< T >::error_fn = nullptr

An optional error function. If present, all calls will be followed by an error check.

Definition at line 97 of file proc_table_gles.h.

Referenced by impeller::GLProc< T >::operator()(), and impeller::GLProc< T >::Reset().

◆ function

template<class T >
GLFunctionType* impeller::GLProc< T >::function = nullptr

The pointer to the GL function.

Definition at line 91 of file proc_table_gles.h.

Referenced by impeller::GLProc< T >::IsAvailable(), impeller::GLProc< T >::operator()(), and impeller::GLProc< T >::Reset().

◆ log_calls

template<class T >
bool impeller::GLProc< T >::log_calls = false

Whether the OpenGL call and its arguments should be logged.

Only works in IMPELLER_DEBUG and for environments where traditional tracing is hard. Expect log spam and only use during development.

Definition at line 105 of file proc_table_gles.h.

Referenced by impeller::GLProc< T >::operator()().

◆ name

template<class T >
std::string_view impeller::GLProc< T >::name = {}

The name of the GL function.

Definition at line 86 of file proc_table_gles.h.

86{};

Referenced by impeller::GLProc< T >::operator()(), and impeller::testing::TEST().


The documentation for this struct was generated from the following file: