blob: 750b9ae3322761ce98a921d70117c636a0d4ba46 [file]
/*
* Copyright 2018 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUniqueCFRef_DEFINED
#define SkUniqueCFRef_DEFINED
#include "include/core/SkTypes.h"
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
#include "include/private/base/SkTemplates.h"
#include <CoreFoundation/CoreFoundation.h>
#include <memory>
#include <type_traits>
template <typename CFRef> using SkUniqueCFRef =
std::unique_ptr<std::remove_pointer_t<CFRef>, SkFunctionObject<CFRelease>>;
#endif
#endif