xref: /aosp_15_r20/external/skia/tools/skottie_ios_app/GrContextHolder.mm (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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
16GrContextHolder SkMakeGLContext() {
17    return GrContextHolder(GrDirectContexts::MakeGL(nullptr, GrContextOptions()).release());
18}
19#endif
20
21void GrContextRelease::operator()(GrDirectContext* ptr) { SkSafeUnref(ptr); }
22
23#else
24
25void GrContextRelease::operator()(GrDirectContext*) { SkDEBUGFAIL(""); }
26
27#endif
28