Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrGLMakeNativeInterface_webgl.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
10
11#include <GLES3/gl32.h>
12
13static GrGLFuncPtr webgl_get_gl_proc(void* ctx, const char name[]) {
14
15 #define M(X) if (0 == strcmp(#X, name)) { return (GrGLFuncPtr) X; }
16 M(glGetString)
17 #undef M
18
19 // We explicitly do not use GetProcAddress or something similar because
20 // its code size is quite large. We shouldn't need GetProcAddress
21 // because emscripten provides us all the valid function pointers
22 // for WebGL via the included headers.
23 // https://github.com/emscripten-core/emscripten/blob/7ba7700902c46734987585409502f3c63beb650f/system/include/emscripten/html5_webgl.h#L93
24 SkASSERTF(false, "Can't lookup fn %s\n", name);
25 return nullptr;
26}
27
28namespace GrGLInterfaces {
32} // namespace GrGLInterfaces
33
34#if !defined(SK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE)
38#endif
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetProc get)
void(* GrGLFuncPtr)()
sk_sp< const GrGLInterface > GrGLMakeNativeInterface()
#define M(X)
static GrGLFuncPtr webgl_get_gl_proc(void *ctx, const char name[])
#define SkASSERTF(cond, fmt,...)
Definition SkAssert.h:117
const char * name
Definition fuchsia.cc:50
SK_API sk_sp< const GrGLInterface > MakeWebGL()