skia2/include/ports/SkFontMgr_fontconfig.h
Ben Wagner 3546ff10c2 Stage SkFontMgr factories to return smart pointers.
All the SkFontMgr factories currently return bare pointers and sometimes
even document the ownership rules. Since such factories can be
implemented by external ports, the ownership rules should be explicit in
order to prevent simple reference counting issues.

Change-Id: I25b598ce0954cd473a3fb1f8adc0cb86331583ca
Reviewed-on: https://skia-review.googlesource.com/6533
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-04 14:51:09 +00:00

27 lines
688 B
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkFontMgr_fontconfig_DEFINED
#define SkFontMgr_fontconfig_DEFINED
#include "SkTypes.h"
#include <fontconfig/fontconfig.h>
class SkFontMgr;
/** Create a font manager around a FontConfig instance.
* If 'fc' is NULL, will use a new default config.
* Takes ownership of 'fc' and will call FcConfigDestroy on it.
*/
#ifdef SK_LEGACY_FONTMGR_FACTORY
SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc);
#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
#endif
#endif // #ifndef SkFontMgr_fontconfig_DEFINED