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

Unified Diff: core/fxge/skia/fx_skia_device.cpp

Issue 2057343002: use pos text (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/skia/fx_skia_device.cpp
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 86a8269b7947573a820a40497dd720fb36997bca..6b2e2a2623d93a8651e10f8e59007df44304d0f3 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698