OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "core/fxcodec/include/fx_codec.h" | 10 #include "core/fxcodec/include/fx_codec.h" |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 return face_cache; | 731 return face_cache; |
732 } | 732 } |
733 | 733 |
734 #ifdef _SKIA_SUPPORT_ | 734 #ifdef _SKIA_SUPPORT_ |
735 CFX_TypeFace* CFX_FontCache::GetDeviceCache(CFX_Font* pFont) { | 735 CFX_TypeFace* CFX_FontCache::GetDeviceCache(CFX_Font* pFont) { |
736 return GetCachedFace(pFont)->GetDeviceCache(pFont); | 736 return GetCachedFace(pFont)->GetDeviceCache(pFont); |
737 } | 737 } |
738 | 738 |
739 CFX_TypeFace* CFX_FaceCache::GetDeviceCache(CFX_Font* pFont) { | 739 CFX_TypeFace* CFX_FaceCache::GetDeviceCache(CFX_Font* pFont) { |
740 if (!m_pTypeface) { | 740 if (!m_pTypeface) { |
741 m_pTypeface = SkTypeface::CreateFromStream( | 741 m_pTypeface = |
742 new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())); | 742 SkTypeface::MakeFromStream( |
| 743 new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())) |
| 744 .release(); |
743 } | 745 } |
744 return m_pTypeface; | 746 return m_pTypeface; |
745 } | 747 } |
746 #endif | 748 #endif |
747 | 749 |
748 void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont) { | 750 void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont) { |
749 FXFT_Face internal_face = pFont->GetFace(); | 751 FXFT_Face internal_face = pFont->GetFace(); |
750 const bool bExternal = !internal_face; | 752 const bool bExternal = !internal_face; |
751 FXFT_Face face = | 753 FXFT_Face face = |
752 bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face; | 754 bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face; |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 void _CFX_UniqueKeyGen::Generate(int count, ...) { | 1434 void _CFX_UniqueKeyGen::Generate(int count, ...) { |
1433 va_list argList; | 1435 va_list argList; |
1434 va_start(argList, count); | 1436 va_start(argList, count); |
1435 for (int i = 0; i < count; i++) { | 1437 for (int i = 0; i < count; i++) { |
1436 int p = va_arg(argList, int); | 1438 int p = va_arg(argList, int); |
1437 ((uint32_t*)m_Key)[i] = p; | 1439 ((uint32_t*)m_Key)[i] = p; |
1438 } | 1440 } |
1439 va_end(argList); | 1441 va_end(argList); |
1440 m_KeyLen = count * sizeof(uint32_t); | 1442 m_KeyLen = count * sizeof(uint32_t); |
1441 } | 1443 } |
OLD | NEW |