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