summaryrefslogtreecommitdiff
path: root/core/fxge/win32/cfx_psrenderer.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-15 11:07:32 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-15 17:47:57 +0000
commite4602321f3175fa5addb6761d0e94f5c2fc93d0c (patch)
tree6671774659645fad6d9ce55a5910b4665a25094f /core/fxge/win32/cfx_psrenderer.cpp
parenteb55885e9a9eec670ed98cbd12dc96d63e6a6623 (diff)
downloadpdfium-e4602321f3175fa5addb6761d0e94f5c2fc93d0c.tar.xz
Cleanup CFX_PathData.
This CL replaces the array of path points with a vector. Cleaning up the usage as required. Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238 Reviewed-on: https://pdfium-review.googlesource.com/2710 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/win32/cfx_psrenderer.cpp')
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 7fc47b9a46..d5f1f4d91c 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -109,10 +109,11 @@ void CFX_PSRenderer::RestoreState(bool bKeepSaved) {
void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData,
const CFX_Matrix* pObject2Device) {
- int nPoints = pPathData->GetPointCount();
CFX_ByteTextBuf buf;
- buf.EstimateSize(nPoints * 10);
- for (int i = 0; i < nPoints; i++) {
+ size_t size = pPathData->GetPoints().size();
+ buf.EstimateSize(size * 10);
+
+ for (size_t i = 0; i < size; i++) {
FXPT_TYPE type = pPathData->GetType(i);
bool closing = pPathData->IsClosingFigure(i);
FX_FLOAT x = pPathData->GetPointX(i);
@@ -592,17 +593,17 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache,
matrix.Concat(CFX_Matrix(1.0f, 0, 0, 1.0f, 0, 0));
const CFX_PathData* pPathData = pFaceCache->LoadGlyphPath(
pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
- if (!pPathData) {
+ if (!pPathData)
return;
- }
+
CFX_PathData TransformedPath(*pPathData);
- if (charpos.m_bGlyphAdjust) {
+ if (charpos.m_bGlyphAdjust)
TransformedPath.Transform(&matrix);
- }
+
CFX_ByteTextBuf buf;
buf << "/X" << *ps_fontnum << " Ff/CharProcs get begin/" << glyphindex
<< "{n ";
- for (int p = 0; p < TransformedPath.GetPointCount(); p++) {
+ for (size_t p = 0; p < TransformedPath.GetPoints().size(); p++) {
FX_FLOAT x = TransformedPath.GetPointX(p), y = TransformedPath.GetPointY(p);
switch (TransformedPath.GetType(p)) {
case FXPT_TYPE::MoveTo: {