SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontMgr> proxy) {
    sk_sp<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
    if (!impl) {
        return nullptr;
    }
    return sk_make_sp<SkFontMgr_Indirect>(std::move(impl), std::move(proxy));
}
Esempio n. 2
0
SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
    SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
    if (impl.get() == nullptr) {
        return nullptr;
    }
    return new SkFontMgr_Indirect(impl.get(), proxy);
}
Esempio n. 3
0
SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
    SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
    if (impl.get() == NULL) {
        return NULL;
    }
    return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy));
}
Esempio n. 4
0
FontCache::FontCache()
    : m_purgePreventCount(0)
{
    SkFontMgr* fontManager;

    if (s_useDirectWrite) {
        fontManager = SkFontMgr_New_DirectWrite(s_directWriteFactory);
        s_useSubpixelPositioning = RuntimeEnabledFeatures::subpixelFontScalingEnabled();
    } else {
        fontManager = SkFontMgr_New_GDI();
        // Subpixel text positioning is not supported by the GDI backend.
        s_useSubpixelPositioning = false;
    }

    ASSERT(fontManager);
    m_fontManager = adoptPtr(fontManager);
}
Esempio n. 5
0
FontCache::FontCache()
    : m_purgePreventCount(0)
{
    SkFontMgr* fontManager = 0;

    // Prefer DirectWrite (if runtime feature is enabled) but fallback
    // to GDI on platforms where DirectWrite is not supported.
    if (RuntimeEnabledFeatures::directWriteEnabled())
        fontManager = SkFontMgr_New_DirectWrite();

    // Subpixel text positioning is not supported by the GDI backend.
    m_useSubpixelPositioning = fontManager
        ? RuntimeEnabledFeatures::subpixelFontScalingEnabled()
        : false;

    if (!fontManager)
        fontManager = SkFontMgr_New_GDI();

    m_fontManager = adoptPtr(fontManager);
}
SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
                                                  IDWriteFontCollection* collection) {
    return SkFontMgr_New_DirectWrite(factory, collection, nullptr);
}
SkFontMgr* SkFontMgr::Factory() {
    return SkFontMgr_New_DirectWrite();
}
Esempio n. 8
0
FontCache::FontCache() : m_purgePreventCount(0) {
  m_fontManager = sk_ref_sp(s_staticFontManager);
  if (!m_fontManager)
    m_fontManager.reset(SkFontMgr_New_DirectWrite());
  ASSERT(m_fontManager.get());
}