summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-21 16:24:57 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-22 00:47:01 +0000
commit55d1d0191ea8316df32858d8cc62fb7c620e8613 (patch)
treecafa0777ebfe8a5b2b7e8e589caf77e3249292f3 /core/fxge
parent52f69b39403b1ac0df0fdf45698e80e60c0f2def (diff)
downloadpdfium-55d1d0191ea8316df32858d8cc62fb7c620e8613.tar.xz
Remove CFX_FixedBufGrow
This Cl replaces the CFX_FixedBufGrow class with std::vector. Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe Reviewed-on: https://pdfium-review.googlesource.com/3138 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/apple/fx_apple_platform.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 20e86ed483..33e675c0a8 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -4,6 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+#include <vector>
+
#include "core/fxcrt/fx_system.h"
#ifndef _SKIA_SUPPORT_
@@ -55,8 +58,8 @@ 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(std::max(32, nChars));
+ std::vector<CGPoint> glyph_positions(std::max(32, nChars));
for (int i = 0; i < nChars; i++) {
glyph_indices[i] =
pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID : pCharPos[i].m_GlyphIndex;
@@ -74,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