1 /* 2 * Copyright 2023 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 #ifndef GrGLDirectContext_DEFINED 9 #define GrGLDirectContext_DEFINED 10 11 #include "include/core/SkRefCnt.h" 12 #include "include/private/base/SkAPI.h" 13 14 class GrDirectContext; 15 struct GrContextOptions; 16 struct GrGLInterface; 17 18 namespace GrDirectContexts { 19 /** 20 * Creates a GrDirectContext for a backend context. GrGLInterface must be non-null. 21 */ 22 SK_API sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&); 23 SK_API sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>); 24 #if !defined(SK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE) 25 SK_API sk_sp<GrDirectContext> MakeGL(const GrContextOptions&); 26 SK_API sk_sp<GrDirectContext> MakeGL(); 27 #endif 28 } 29 30 #endif 31