xref: /aosp_15_r20/external/skia/include/gpu/ganesh/gl/GrGLAssembleInterface.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 #ifndef GrGLAssembleInterface_DEFINED
8 #define GrGLAssembleInterface_DEFINED
9 
10 #include "include/core/SkRefCnt.h"
11 #include "include/gpu/ganesh/gl/GrGLInterface.h"
12 #include "include/private/base/SkAPI.h"
13 
14 typedef GrGLFuncPtr (*GrGLGetProc)(void* ctx, const char name[]);
15 
16 /**
17  * Generic function for creating a GrGLInterface for an either OpenGL or GLES. It calls
18  * get() to get each function address. ctx is a generic ptr passed to and interpreted by get().
19  */
20 SK_API sk_sp<const GrGLInterface> GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get);
21 
22 /**
23  * Generic function for creating a GrGLInterface for an OpenGL (but not GLES) context. It calls
24  * get() to get each function address. ctx is a generic ptr passed to and interpreted by get().
25  */
26 SK_API sk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get);
27 
28 /**
29  * Generic function for creating a GrGLInterface for an OpenGL ES (but not Open GL) context. It
30  * calls get() to get each function address. ctx is a generic ptr passed to and interpreted by
31  * get().
32  */
33 SK_API sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get);
34 
35 /**
36  * Generic function for creating a GrGLInterface for a WebGL (similar to OpenGL ES) context. It
37  * calls get() to get each function address. ctx is a generic ptr passed to and interpreted by
38  * get().
39  */
40 SK_API sk_sp<const GrGLInterface> GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetProc get);
41 
42 /** Deprecated version of GrGLMakeAssembledInterface() that returns a bare pointer. */
43 SK_API const GrGLInterface* GrGLAssembleInterface(void *ctx, GrGLGetProc get);
44 
45 #endif  // GrGLAssembleInterface_DEFINED
46