Flutter Impeller
impeller::AutoErrorCheck Struct Reference

#include <proc_table_gles.h>

Public Member Functions

 AutoErrorCheck (PFNGLGETERRORPROC error, std::string_view name)
 
 ~AutoErrorCheck ()
 

Public Attributes

const PFNGLGETERRORPROC error_fn
 
std::string_view name
 

Detailed Description

Definition at line 26 of file proc_table_gles.h.

Constructor & Destructor Documentation

◆ AutoErrorCheck()

impeller::AutoErrorCheck::AutoErrorCheck ( PFNGLGETERRORPROC  error,
std::string_view  name 
)
inline

Definition at line 33 of file proc_table_gles.h.

34  : error_fn(error), name(name) {}
const PFNGLGETERRORPROC error_fn

◆ ~AutoErrorCheck()

impeller::AutoErrorCheck::~AutoErrorCheck ( )
inline

Definition at line 36 of file proc_table_gles.h.

36  {
37  if (error_fn) {
38  auto error = error_fn();
39  if (error == GL_NO_ERROR) {
40  return;
41  }
42  if (GLErrorIsFatal(error)) {
43  FML_LOG(FATAL) << "Fatal GL Error " << GLErrorToString(error) << "("
44  << error << ")" << " encountered on call to " << name;
45  } else {
46  FML_LOG(ERROR) << "GL Error " << GLErrorToString(error) << "(" << error
47  << ")" << " encountered on call to " << name;
48  }
49  }
50  }
std::string_view GLErrorToString(GLenum value)
bool GLErrorIsFatal(GLenum value)

References error_fn, impeller::GLErrorIsFatal(), impeller::GLErrorToString(), and name.

Member Data Documentation

◆ error_fn

const PFNGLGETERRORPROC impeller::AutoErrorCheck::error_fn

Definition at line 27 of file proc_table_gles.h.

Referenced by ~AutoErrorCheck().

◆ name

std::string_view impeller::AutoErrorCheck::name

Name of the GL call being wrapped. should not be stored beyond the caller's lifetime.

Definition at line 31 of file proc_table_gles.h.

Referenced by ~AutoErrorCheck().


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