Debian Codegraph @

tools/skottie_ios_app/GrContextHolder.mm

raw
1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
4 #include "tools/skottie_ios_app/GrContextHolder.h"
5
6 #include "include/core/SkTypes.h"
7
8 #if defined(SK_GANESH)
9
10 #include "include/gpu/ganesh/GrContextOptions.h"
11 #include "include/gpu/ganesh/GrDirectContext.h"
12 #include "include/gpu/ganesh/gl/GrGLDirectContext.h"
13 #include "include/gpu/ganesh/gl/GrGLInterface.h"
14
15 #ifdef SK_GL
16 GrContextHolder SkMakeGLContext() {
17 return GrContextHolder(GrDirectContexts::MakeGL(nullptr, GrContextOptions()).release());
18 }
19 #endif
20
21 void GrContextRelease::operator()(GrDirectContext* ptr) { SkSafeUnref(ptr); }
22
23 #else
24
25 void GrContextRelease::operator()(GrDirectContext*) { SkDEBUGFAIL(""); }
26
27 #endif