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 "xfa/fde/fde_render.h" | 7 #include "xfa/fde/fde_render.h" |
8 | 8 |
9 #include "xfa/fde/fde_gedevice.h" | 9 #include "xfa/fde/fde_gedevice.h" |
10 #include "xfa/fde/fde_object.h" | 10 #include "xfa/fde/fde_object.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 FX_Free(m_pCharPos); | 104 FX_Free(m_pCharPos); |
105 m_pCharPos = nullptr; | 105 m_pCharPos = nullptr; |
106 m_iCharPosCount = 0; | 106 m_iCharPosCount = 0; |
107 } | 107 } |
108 | 108 |
109 void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet, | 109 void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet, |
110 FDE_TEXTEDITPIECE* pText) { | 110 FDE_TEXTEDITPIECE* pText) { |
111 ASSERT(m_pRenderDevice); | 111 ASSERT(m_pRenderDevice); |
112 ASSERT(pTextSet && pText); | 112 ASSERT(pTextSet && pText); |
113 | 113 |
114 IFGAS_Font* pFont = pTextSet->GetFont(); | 114 CFGAS_GEFont* pFont = pTextSet->GetFont(); |
115 if (!pFont) | 115 if (!pFont) |
116 return; | 116 return; |
117 | 117 |
118 int32_t iCount = pTextSet->GetDisplayPos(pText, nullptr, FALSE); | 118 int32_t iCount = pTextSet->GetDisplayPos(pText, nullptr, FALSE); |
119 if (iCount < 1) | 119 if (iCount < 1) |
120 return; | 120 return; |
121 | 121 |
122 if (!m_pBrush) | 122 if (!m_pBrush) |
123 m_pBrush.reset(new CFDE_Brush); | 123 m_pBrush.reset(new CFDE_Brush); |
124 | 124 |
125 if (!m_pCharPos) | 125 if (!m_pCharPos) |
126 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, iCount); | 126 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, iCount); |
127 else if (m_iCharPosCount < iCount) | 127 else if (m_iCharPosCount < iCount) |
128 m_pCharPos = FX_Realloc(FXTEXT_CHARPOS, m_pCharPos, iCount); | 128 m_pCharPos = FX_Realloc(FXTEXT_CHARPOS, m_pCharPos, iCount); |
129 | 129 |
130 if (m_iCharPosCount < iCount) | 130 if (m_iCharPosCount < iCount) |
131 m_iCharPosCount = iCount; | 131 m_iCharPosCount = iCount; |
132 | 132 |
133 iCount = pTextSet->GetDisplayPos(pText, m_pCharPos, FALSE); | 133 iCount = pTextSet->GetDisplayPos(pText, m_pCharPos, FALSE); |
134 FX_FLOAT fFontSize = pTextSet->GetFontSize(); | 134 FX_FLOAT fFontSize = pTextSet->GetFontSize(); |
135 FX_ARGB dwColor = pTextSet->GetFontColor(); | 135 FX_ARGB dwColor = pTextSet->GetFontColor(); |
136 m_pBrush->SetColor(dwColor); | 136 m_pBrush->SetColor(dwColor); |
137 m_pRenderDevice->DrawString(m_pBrush.get(), pFont, m_pCharPos, iCount, | 137 m_pRenderDevice->DrawString(m_pBrush.get(), pFont, m_pCharPos, iCount, |
138 fFontSize, &m_Transform); | 138 fFontSize, &m_Transform); |
139 } | 139 } |
140 | 140 |
OLD | NEW |