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

Side by Side Diff: core/src/fpdfapi/fpdf_render/render_int.h

Issue 1301793002: Merge to XFA: CFX_MapByteStringToPtr considered harmful (combo patch). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 | « core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fxcodec/codec/codec_int.h » ('j') | 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 #ifndef CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 7 #ifndef CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
9 9
10 #include <map> 10 #include <map>
11 11
12 #include "../../../../third_party/base/nonstd_unique_ptr.h" 12 #include "../../../../third_party/base/nonstd_unique_ptr.h"
13 #include "../../../include/fpdfapi/fpdf_pageobj.h" 13 #include "../../../include/fpdfapi/fpdf_pageobj.h"
14 14
15 class CFX_GlyphBitmap;
15 class CPDF_QuickStretcher; 16 class CPDF_QuickStretcher;
17
16 #define TYPE3_MAX_BLUES 16 18 #define TYPE3_MAX_BLUES 16
19
17 class CPDF_Type3Glyphs { 20 class CPDF_Type3Glyphs {
18 public: 21 public:
19 CPDF_Type3Glyphs() { 22 CPDF_Type3Glyphs() {
20 m_GlyphMap.InitHashTable(253); 23 m_GlyphMap.InitHashTable(253);
21 m_TopBlueCount = m_BottomBlueCount = 0; 24 m_TopBlueCount = m_BottomBlueCount = 0;
22 } 25 }
23 ~CPDF_Type3Glyphs(); 26 ~CPDF_Type3Glyphs();
24 CFX_MapPtrToPtr m_GlyphMap; 27 CFX_MapPtrToPtr m_GlyphMap;
25 void AdjustBlue(FX_FLOAT top, 28 void AdjustBlue(FX_FLOAT top,
26 FX_FLOAT bottom, 29 FX_FLOAT bottom,
27 int& top_line, 30 int& top_line,
28 int& bottom_line); 31 int& bottom_line);
29 32
30 int m_TopBlue[TYPE3_MAX_BLUES], m_BottomBlue[TYPE3_MAX_BLUES]; 33 int m_TopBlue[TYPE3_MAX_BLUES], m_BottomBlue[TYPE3_MAX_BLUES];
31 int m_TopBlueCount, m_BottomBlueCount; 34 int m_TopBlueCount, m_BottomBlueCount;
32 }; 35 };
33 class CFX_GlyphBitmap;
34 class CPDF_Type3Cache { 36 class CPDF_Type3Cache {
35 public: 37 public:
36 CPDF_Type3Cache(CPDF_Type3Font* pFont) { m_pFont = pFont; } 38 explicit CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {}
37 ~CPDF_Type3Cache(); 39 ~CPDF_Type3Cache();
40
38 CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, 41 CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode,
39 const CFX_AffineMatrix* pMatrix, 42 const CFX_AffineMatrix* pMatrix,
40 FX_FLOAT retinaScaleX = 1.0f, 43 FX_FLOAT retinaScaleX = 1.0f,
41 FX_FLOAT retinaScaleY = 1.0f); 44 FX_FLOAT retinaScaleY = 1.0f);
42 45
43 protected: 46 protected:
44 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, 47 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize,
45 FX_DWORD charcode, 48 FX_DWORD charcode,
46 const CFX_AffineMatrix* pMatrix, 49 const CFX_AffineMatrix* pMatrix,
47 FX_FLOAT retinaScaleX = 1.0f, 50 FX_FLOAT retinaScaleX = 1.0f,
48 FX_FLOAT retinaScaleY = 1.0f); 51 FX_FLOAT retinaScaleY = 1.0f);
49 CPDF_Type3Font* m_pFont; 52 CPDF_Type3Font* const m_pFont;
50 CFX_MapByteStringToPtr m_SizeMap; 53 std::map<CFX_ByteString, CPDF_Type3Glyphs*> m_SizeMap;
51 }; 54 };
52 class CPDF_TransferFunc { 55 class CPDF_TransferFunc {
53 public: 56 public:
54 CPDF_Document* m_pPDFDoc; 57 CPDF_Document* m_pPDFDoc;
55 uint8_t m_Samples[256 * 3]; 58 uint8_t m_Samples[256 * 3];
56 FX_BOOL m_bIdentity; 59 FX_BOOL m_bIdentity;
57 60
58 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, 61 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc,
59 FX_BOOL bAutoDropSrc); 62 FX_BOOL bAutoDropSrc);
60 FX_COLORREF TranslateColor(FX_COLORREF src); 63 FX_COLORREF TranslateColor(FX_COLORREF src);
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 const uint8_t* m_RampB; 607 const uint8_t* m_RampB;
605 }; 608 };
606 609
607 struct _CPDF_UniqueKeyGen { 610 struct _CPDF_UniqueKeyGen {
608 void Generate(int count, ...); 611 void Generate(int count, ...);
609 FX_CHAR m_Key[128]; 612 FX_CHAR m_Key[128];
610 int m_KeyLen; 613 int m_KeyLen;
611 }; 614 };
612 615
613 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 616 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fxcodec/codec/codec_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698