2019-12-18 21:26:19 +00:00
|
|
|
// Copyright 2019 Google LLC.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "tools/skottie_ios_app/GrContextHolder.h"
|
|
|
|
|
|
|
|
#include "include/core/SkTypes.h"
|
|
|
|
|
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
|
|
|
|
#include "include/gpu/GrContextOptions.h"
|
2020-08-13 19:06:09 +00:00
|
|
|
#include "include/gpu/GrDirectContext.h"
|
2019-12-18 21:26:19 +00:00
|
|
|
#include "include/gpu/gl/GrGLInterface.h"
|
|
|
|
|
2020-03-19 19:54:28 +00:00
|
|
|
#ifdef SK_GL
|
2019-12-18 21:26:19 +00:00
|
|
|
GrContextHolder SkMakeGLContext() {
|
2020-09-23 18:01:58 +00:00
|
|
|
return GrContextHolder(GrDirectContext::MakeGL(nullptr, GrContextOptions()).release());
|
2019-12-18 21:26:19 +00:00
|
|
|
}
|
2020-03-19 19:54:28 +00:00
|
|
|
#endif
|
2019-12-18 21:26:19 +00:00
|
|
|
|
2020-09-23 18:01:58 +00:00
|
|
|
void GrContextRelease::operator()(GrDirectContext* ptr) { SkSafeUnref(ptr); }
|
2019-12-18 21:26:19 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2020-09-23 18:01:58 +00:00
|
|
|
void GrContextRelease::operator()(GrDirectContext*) { SkDEBUGFAIL(""); }
|
2019-12-18 21:26:19 +00:00
|
|
|
|
|
|
|
#endif
|