SkUniqueCFRef.h 650 B

12345678910111213141516171819202122232425
  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. #ifndef SkUniqueCFRef_DEFINED
  8. #define SkUniqueCFRef_DEFINED
  9. #include "include/core/SkTypes.h"
  10. #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
  11. #include "include/private/SkTLogic.h"
  12. #include "include/private/SkTemplates.h"
  13. #include <CoreFoundation/CoreFoundation.h>
  14. #include <memory>
  15. template <typename CFRef> using SkUniqueCFRef =
  16. std::unique_ptr<skstd::remove_pointer_t<CFRef>,
  17. SkFunctionWrapper<void, skstd::remove_pointer_t<CFTypeRef>, CFRelease>>;
  18. #endif
  19. #endif