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