• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef GrContextHolder_DEFINED
4 #define GrContextHolder_DEFINED
5 
6 #include <memory>
7 
8 class GrDirectContext;
9 
10 // A struct to take ownership of a GrDirectContext.
11 struct GrContextRelease { void operator()(GrDirectContext*); };
12 using GrContextHolder = std::unique_ptr<GrDirectContext, GrContextRelease>;
13 
14 // Wrapper around GrDirectContext::MakeGL
15 GrContextHolder SkMakeGLContext();
16 
17 #endif  // GrContextHolder_DEFINED
18