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 SK_SUPPORT_GPU 9 10#include "include/gpu/GrContextOptions.h" 11#include "include/gpu/GrDirectContext.h" 12#include "include/gpu/gl/GrGLInterface.h" 13 14#ifdef SK_GL 15GrContextHolder SkMakeGLContext() { 16 return GrContextHolder(GrDirectContext::MakeGL(nullptr, GrContextOptions()).release()); 17} 18#endif 19 20void GrContextRelease::operator()(GrDirectContext* ptr) { SkSafeUnref(ptr); } 21 22#else 23 24void GrContextRelease::operator()(GrDirectContext*) { SkDEBUGFAIL(""); } 25 26#endif 27