diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-29 23:53:53 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-29 23:53:53 +0000 |
commit | 20c41a5a47b2460277897a1059789fc9e184e3ab (patch) | |
tree | a60b9695de7242be833c4119bb9815bd39b297ca /core/fxge/cfx_facecache.cpp | |
parent | 8020fd856805ed5c5f48a7a5f3a346ea6948355f (diff) | |
download | pdfium-20c41a5a47b2460277897a1059789fc9e184e3ab.tar.xz |
Use pdfium::span<>/UnownedPtr in CFX_Font.
Move some platform-specific ifdefs so the come last in each
section as it is easier to read, perhaps.
Change-Id: Ic1c2652c46ecebc63b66213735ed6d94737a7f32
Reviewed-on: https://pdfium-review.googlesource.com/41630
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/cfx_facecache.cpp')
-rw-r--r-- | core/fxge/cfx_facecache.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp index c2051c30fc..08d95a0cb8 100644 --- a/core/fxge/cfx_facecache.cpp +++ b/core/fxge/cfx_facecache.cpp @@ -315,14 +315,16 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { if (!m_pTypeface) { + pdfium::span<const uint8_t> span = pFont->GetFontSpan(); m_pTypeface = SkTypeface::MakeFromStream( - new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())); + new SkMemoryStream(span.data(), span.size())); } #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (!m_pTypeface) { sk_sp<SkFontMgr> customMgr(SkFontMgr_New_Custom_Empty()); - m_pTypeface = customMgr->makeFromStream(pdfium::MakeUnique<SkMemoryStream>( - pFont->GetFontData(), pFont->GetSize())); + pdfium::span<const uint8_t> span = pFont->GetFontSpan(); + m_pTypeface = customMgr->makeFromStream( + pdfium::MakeUnique<SkMemoryStream>(span.data(), span.size())); } #endif return m_pTypeface.get(); |