| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/fxge/include/cfx_facecache.h" | 7 #include "core/fxge/include/cfx_facecache.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 m_SizeMap[FaceGlyphsKey] = std::unique_ptr<CFX_SizeGlyphCache>(pSizeCache); | 379 m_SizeMap[FaceGlyphsKey] = std::unique_ptr<CFX_SizeGlyphCache>(pSizeCache); |
| 380 } else { | 380 } else { |
| 381 pSizeCache = it->second.get(); | 381 pSizeCache = it->second.get(); |
| 382 } | 382 } |
| 383 auto it2 = pSizeCache->m_GlyphMap.find(glyph_index); | 383 auto it2 = pSizeCache->m_GlyphMap.find(glyph_index); |
| 384 if (it2 != pSizeCache->m_GlyphMap.end()) | 384 if (it2 != pSizeCache->m_GlyphMap.end()) |
| 385 return it2->second; | 385 return it2->second; |
| 386 | 386 |
| 387 CFX_GlyphBitmap* pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, | 387 CFX_GlyphBitmap* pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, |
| 388 pMatrix, dest_width, anti_alias); | 388 pMatrix, dest_width, anti_alias); |
| 389 if (!pGlyphBitmap) | |
| 390 return nullptr; | |
| 391 | |
| 392 pSizeCache->m_GlyphMap[glyph_index] = pGlyphBitmap; | 389 pSizeCache->m_GlyphMap[glyph_index] = pGlyphBitmap; |
| 393 return pGlyphBitmap; | 390 return pGlyphBitmap; |
| 394 } | 391 } |
| OLD | NEW |