summaryrefslogtreecommitdiff
path: root/core/fxge/apple/fx_apple_platform.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2018-05-08 19:13:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-08 19:13:28 +0000
commit5de481e71bcde25d31452b23a017bb783163a204 (patch)
tree69a83cba07d67550f65ba27633ab1ad40e5035ae /core/fxge/apple/fx_apple_platform.cpp
parent12d61f16381da571c7f435c9c4f9bd51daa57222 (diff)
downloadpdfium-5de481e71bcde25d31452b23a017bb783163a204.tar.xz
Remove almost all usages of CFX_FixedBufGrow with std::vector
Tested by running safetynet_compare.py on this patch vs master. The results were 0 regressions and 0 improvements. The two remaining usages cannot be replaced because they would cause a regression. Bug: pdfium:177 Change-Id: I43eddf4ffaac2eb063f2004d6606bc3cd6e627ac Reviewed-on: https://pdfium-review.googlesource.com/32159 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fxge/apple/fx_apple_platform.cpp')
-rw-r--r--core/fxge/apple/fx_apple_platform.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 1801814e66..013be8f414 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -5,8 +5,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include <memory>
+#include <vector>
-#include "core/fxcrt/cfx_fixedbufgrow.h"
#include "core/fxcrt/fx_system.h"
#ifndef _SKIA_SUPPORT_
@@ -57,11 +57,12 @@ bool CGDrawGlyphRun(CGContextRef pContext,
if (!pFont->GetPlatformFont())
return false;
}
- CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars);
- CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
+ std::vector<uint16_t> glyph_indices;
+ glyph_indices.reserve(nChars);
+ std::vector<CGPoint> glyph_positions(nChars);
for (int i = 0; i < nChars; i++) {
- glyph_indices[i] =
- pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID : pCharPos[i].m_GlyphIndex;
+ glyph_indices.push_back(pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID
+ : pCharPos[i].m_GlyphIndex);
if (bNegSize)
glyph_positions[i].x = -pCharPos[i].m_Origin.x;
else
@@ -76,9 +77,9 @@ bool CGDrawGlyphRun(CGContextRef pContext,
new_matrix.d = -new_matrix.d;
}
quartz2d.setGraphicsTextMatrix(pContext, &new_matrix);
- return quartz2d.drawGraphicsString(pContext, pFont->GetPlatformFont(),
- font_size, glyph_indices, glyph_positions,
- nChars, argb, nullptr);
+ return quartz2d.drawGraphicsString(
+ pContext, pFont->GetPlatformFont(), font_size, glyph_indices.data(),
+ glyph_positions.data(), nChars, argb, nullptr);
}
} // namespace