Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
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

const char * name = nullptr
 
GLFunctionTypefunction = nullptr
 
PFNGLGETERRORPROC error_fn = nullptr
 

Detailed Description

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

Definition at line 50 of file proc_table_gles.h.

Member Typedef Documentation

◆ GLFunctionType

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

Definition at line 51 of file proc_table_gles.h.

Member Function Documentation

◆ IsAvailable()

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

Definition at line 94 of file proc_table_gles.h.

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

◆ 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 79 of file proc_table_gles.h.

79 {
80#ifdef IMPELLER_DEBUG
81 AutoErrorCheck error(error_fn, name);
82 // We check for the existence of extensions, and reset the function pointer
83 // but it's still called unconditionally below, and will segfault. This
84 // validation log will at least give us a hint as to what's going on.
85 FML_CHECK(IsAvailable()) << "GL function " << name << " is not available. "
86 << "This is likely due to a missing extension.";
87#endif // IMPELLER_DEBUG
88#ifdef IMPELLER_TRACE_ALL_GL_CALLS
89 TRACE_EVENT0("impeller", name);
90#endif // IMPELLER_TRACE_ALL_GL_CALLS
91 return function(std::forward<Args>(args)...);
92 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
#define FML_CHECK(condition)
Definition logging.h:85
const char * name
constexpr bool IsAvailable() const
PFNGLGETERRORPROC error_fn
#define TRACE_EVENT0(category_group, name)

◆ Reset()

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

Definition at line 96 of file proc_table_gles.h.

96 {
97 function = nullptr;
98 error_fn = nullptr;
99 }

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 70 of file proc_table_gles.h.

◆ function

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

The pointer to the GL function.

Definition at line 64 of file proc_table_gles.h.

◆ name

template<class T >
const char* impeller::GLProc< T >::name = nullptr

The name of the GL function.

Definition at line 59 of file proc_table_gles.h.


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