Flutter Engine
The Flutter Engine
GrGLAssembleInterface.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
13
14#define GET_PROC_LOCAL(F) GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)
15
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)) {
33 } else if (GR_IS_GR_GL(standard)) {
35 } else if (GR_IS_GR_WEBGL(standard)) {
37 }
38 return nullptr;
39}
40
43}
sk_sp< const GrGLInterface > GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get)
const GrGLInterface * GrGLAssembleInterface(void *ctx, GrGLGetProc get)
#define GET_PROC_LOCAL(F)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get)
GrGLFuncPtr(* GrGLGetProc)(void *ctx, const char name[])
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
Definition: GrGLDefines.h:602
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
T * release()
Definition: SkRefCnt.h:324
const myers::Point & get(const myers::Segment &)