Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: core/src/fxge/ge/fx_ge_text.cpp

Issue 1296383004: Fix fix fix fix of breakage on mac. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxge/fx_freetype.h" 8 #include "../../../include/fxge/fx_freetype.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 #include "text_int.h" 10 #include "text_int.h"
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen); 1327 CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
1328 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ 1328 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
1329 return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, 1329 return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index,
1330 bFontStyle, dest_width, anti_alias); 1330 bFontStyle, dest_width, anti_alias);
1331 #else 1331 #else
1332 if (text_flags & FXTEXT_NO_NATIVETEXT) { 1332 if (text_flags & FXTEXT_NO_NATIVETEXT) {
1333 return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, 1333 return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index,
1334 bFontStyle, dest_width, anti_alias); 1334 bFontStyle, dest_width, anti_alias);
1335 } 1335 }
1336 CFX_GlyphBitmap* pGlyphBitmap; 1336 CFX_GlyphBitmap* pGlyphBitmap;
1337 CFX_SizeGlyphCache* pSizeCache = NULL; 1337 auto it = m_SizeMap.find(FaceGlyphsKey);
1338 if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) { 1338 if (it != m_SizeMap.end()) {
1339 CFX_SizeGlyphCache* pSizeCache = it->second;
1339 if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index, 1340 if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index,
1340 (void*&)pGlyphBitmap)) { 1341 (void*&)pGlyphBitmap)) {
1341 return pGlyphBitmap; 1342 return pGlyphBitmap;
1342 } 1343 }
1343 pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, 1344 pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix,
1344 dest_width, anti_alias); 1345 dest_width, anti_alias);
1345 if (pGlyphBitmap) { 1346 if (pGlyphBitmap) {
1346 pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap); 1347 pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
1347 return pGlyphBitmap; 1348 return pGlyphBitmap;
1348 } 1349 }
1349 } else { 1350 } else {
1350 pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, 1351 pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix,
1351 dest_width, anti_alias); 1352 dest_width, anti_alias);
1352 if (pGlyphBitmap) { 1353 if (pGlyphBitmap) {
1353 pSizeCache = new CFX_SizeGlyphCache; 1354 pSizeCache = new CFX_SizeGlyphCache;
Lei Zhang 2015/08/18 00:23:19 This needs to be declared.
1354 m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache); 1355 m_SizeMap[FaceGlyphsKey] = pSizeCache;
1355 pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap); 1356 pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
1356 return pGlyphBitmap; 1357 return pGlyphBitmap;
1357 } 1358 }
1358 } 1359 }
1359 if (pFont->GetSubstFont()) 1360 if (pFont->GetSubstFont())
1360 keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000), 1361 keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
1361 (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), 1362 (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000),
1362 dest_width, anti_alias, pFont->GetSubstFont()->m_Weight, 1363 dest_width, anti_alias, pFont->GetSubstFont()->m_Weight,
1363 pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical()); 1364 pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
1364 else 1365 else
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 void _CFX_UniqueKeyGen::Generate(int count, ...) { 1870 void _CFX_UniqueKeyGen::Generate(int count, ...) {
1870 va_list argList; 1871 va_list argList;
1871 va_start(argList, count); 1872 va_start(argList, count);
1872 for (int i = 0; i < count; i++) { 1873 for (int i = 0; i < count; i++) {
1873 int p = va_arg(argList, int); 1874 int p = va_arg(argList, int);
1874 ((FX_DWORD*)m_Key)[i] = p; 1875 ((FX_DWORD*)m_Key)[i] = p;
1875 } 1876 }
1876 va_end(argList); 1877 va_end(argList);
1877 m_KeyLen = count * sizeof(FX_DWORD); 1878 m_KeyLen = count * sizeof(FX_DWORD);
1878 } 1879 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698