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.
|
|
|
|
#ifndef GrContextHolder_DEFINED
|
|
|
|
#define GrContextHolder_DEFINED
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2020-09-23 12:59:23 +00:00
|
|
|
class GrContext;
|
2019-12-18 21:26:19 +00:00
|
|
|
|
2020-09-23 12:59:23 +00:00
|
|
|
// A struct to take ownership of a GrContext.
|
|
|
|
struct GrContextRelease { void operator()(GrContext*); };
|
|
|
|
using GrContextHolder = std::unique_ptr<GrContext, GrContextRelease>;
|
2019-12-18 21:26:19 +00:00
|
|
|
|
2020-09-23 12:59:23 +00:00
|
|
|
// Wrapper around GrContext::MakeGL
|
2019-12-18 21:26:19 +00:00
|
|
|
GrContextHolder SkMakeGLContext();
|
|
|
|
#endif // GrContextHolder_DEFINED
|