• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkUniqueCFRef_DEFINED
9 #define SkUniqueCFRef_DEFINED
10 
11 #include "include/core/SkTypes.h"
12 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
13 
14 #include "include/private/base/SkTemplates.h"
15 
16 #include <CoreFoundation/CoreFoundation.h>
17 #include <memory>
18 #include <type_traits>
19 
20 template <typename CFRef> using SkUniqueCFRef =
21     std::unique_ptr<std::remove_pointer_t<CFRef>, SkFunctionObject<CFRelease>>;
22 
23 #endif
24 #endif
25