Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros | Functions
GrGLAssembleInterface.cpp File Reference
#include "include/gpu/gl/GrGLAssembleInterface.h"
#include "include/gpu/gl/GrGLAssembleHelpers.h"
#include "include/private/base/SkTemplates.h"
#include "src/gpu/ganesh/gl/GrGLUtil.h"

Go to the source code of this file.

Macros

#define GET_PROC_LOCAL(F)   GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)
 

Functions

sk_sp< const GrGLInterfaceGrGLMakeAssembledInterface (void *ctx, GrGLGetProc get)
 
const GrGLInterfaceGrGLAssembleInterface (void *ctx, GrGLGetProc get)
 

Macro Definition Documentation

◆ GET_PROC_LOCAL

#define GET_PROC_LOCAL (   F)    GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)

Definition at line 14 of file GrGLAssembleInterface.cpp.

Function Documentation

◆ GrGLAssembleInterface()

const GrGLInterface * GrGLAssembleInterface ( void *  ctx,
GrGLGetProc  get 
)

Deprecated version of GrGLMakeAssembledInterface() that returns a bare pointer.

Definition at line 41 of file GrGLAssembleInterface.cpp.

41 {
42 return GrGLMakeAssembledInterface(ctx, get).release();
43}
sk_sp< const GrGLInterface > GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get)
T * release()
Definition SkRefCnt.h:324

◆ GrGLMakeAssembledInterface()

sk_sp< const GrGLInterface > GrGLMakeAssembledInterface ( void *  ctx,
GrGLGetProc  get 
)

Generic function for creating a GrGLInterface for an either OpenGL or GLES. It calls get() to get each function address. ctx is a generic ptr passed to and interpreted by get().

Definition at line 16 of file GrGLAssembleInterface.cpp.

16 {
17 GET_PROC_LOCAL(GetString);
18 if (nullptr == GetString) {
19 return nullptr;
20 }
21
22 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
23 if (nullptr == verStr) {
24 return nullptr;
25 }
26
28 // standard can be unused (optimized away) if SK_ASSUME_GL_ES is set
30
31 if (GR_IS_GR_GL_ES(standard)) {
32 return GrGLMakeAssembledGLESInterface(ctx, get);
33 } else if (GR_IS_GR_GL(standard)) {
34 return GrGLMakeAssembledGLInterface(ctx, get);
35 } else if (GR_IS_GR_WEBGL(standard)) {
36 return GrGLMakeAssembledWebGLInterface(ctx, get);
37 }
38 return nullptr;
39}
#define GET_PROC_LOCAL(F)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get)
#define GR_GL_VERSION
GrGLStandard
Definition GrGLTypes.h:19
#define GR_IS_GR_WEBGL(standard)
Definition GrGLTypes.h:50
#define GR_IS_GR_GL(standard)
Definition GrGLTypes.h:48
#define GR_IS_GR_GL_ES(standard)
Definition GrGLTypes.h:49
GrGLStandard GrGLGetStandardInUseFromString(const char *versionString)
Definition GrGLUtil.cpp:31
void sk_ignore_unused_variable(const T &)
Definition SkTemplates.h:37