1 /* 2 * Copyright 2024 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 */ 7 8 #include "include/gpu/gl/GrGLAssembleInterface.h" 9 #include "include/gpu/gl/GrGLInterface.h" 10 #include "src/gpu/ganesh/gl/GrGLCoreFunctions.h" 11 #include "src/gpu/ganesh/gl/GrGLUtil.h" 12 #include "include/gpu/ganesh/gl/epoxy/GrGLMakeEpoxyEGLInterface.h" 13 14 #include <epoxy/egl.h> 15 #include <epoxy/gl.h> 16 epoxy_get_gl_proc(void * ctx,const char name[])17static GrGLFuncPtr epoxy_get_gl_proc(void* ctx, const char name[]) 18 { 19 SkASSERT(nullptr == ctx); 20 #define M(X) if (0 == strcmp(#X, name)) { return (GrGLFuncPtr) epoxy_ ## X; } 21 GR_GL_CORE_FUNCTIONS_EACH(M) 22 #undef M 23 return epoxy_eglGetProcAddress(name); 24 } 25 26 namespace GrGLInterfaces { MakeEpoxyEGL()27sk_sp<const GrGLInterface> MakeEpoxyEGL() { 28 return GrGLMakeAssembledInterface(nullptr, epoxy_get_gl_proc); 29 } 30 } // namespace GrGLInterfaces 31