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

Side by Side Diff: xfa/fde/fde_render.cpp

Issue 2037563002: Replace IFGAS_Font with underlying concrete type (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 6 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 | « xfa/fde/fde_gedevice.cpp ('k') | xfa/fde/fde_visualset.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 #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
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
OLDNEW
« no previous file with comments | « xfa/fde/fde_gedevice.cpp ('k') | xfa/fde/fde_visualset.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698