diff options
author | caryclark <caryclark@google.com> | 2016-06-13 06:17:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-13 06:17:02 -0700 |
commit | 6d4f6ffd38076361ede07d908f73306e5217409a (patch) | |
tree | 22aaedd0ace9e2bea6294ad8d0ce179cf456b19e /core/fxge | |
parent | 72708b905309af930ca76a09746be5d09204cecd (diff) | |
download | pdfium-6d4f6ffd38076361ede07d908f73306e5217409a.tar.xz |
use pos text
Use SkCanvas::drawPosText() to render the whole string
rather than drawing glyphs one at a time.
R=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2057343002
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 86a8269b79..6b2e2a2623 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -605,11 +605,16 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, m_pCanvas->save(); SkMatrix skMatrix = ToFlippedSkMatrix(*pObject2Device); m_pCanvas->concat(skMatrix); + SkTDArray<SkPoint> positions; + positions.setCount(nChars); + SkTDArray<uint16_t> glyphs; + glyphs.setCount(nChars); for (int index = 0; index < nChars; ++index) { const FXTEXT_CHARPOS& cp = pCharPos[index]; - uint16_t glyph = (uint16_t)cp.m_GlyphIndex; - m_pCanvas->drawText(&glyph, 2, cp.m_OriginX, cp.m_OriginY, paint); + positions[index] = {cp.m_OriginX, cp.m_OriginY}; + glyphs[index] = (uint16_t)cp.m_GlyphIndex; } + m_pCanvas->drawPosText(glyphs.begin(), nChars * 2, positions.begin(), paint); m_pCanvas->restore(); return TRUE; } |