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