aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFDevice.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-05-09 15:35:54 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-09 15:36:06 +0000
commit97c1108607584b6050a6880d6ce22846e4913a92 (patch)
treee6cb5bfa22fdd2fba53c9cd49d3beed28fff686b /src/pdf/SkPDFDevice.cpp
parent2ed5f69da6f101e60a3cf49c0767212b563552f3 (diff)
Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode"
This reverts commit 1c2bcd8b14e029a70e88b1e81acd29553cab0d1c. Reason for revert: breaking chrome roll Original change's description: > SkAdvancedTypefaceMetrics: factor out GlyphToUnicode > > Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63 > Reviewed-on: https://skia-review.googlesource.com/126507 > Commit-Queue: Hal Canary <halcanary@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> TBR=halcanary@google.com,bungeman@google.com,reed@google.com Change-Id: Ib1ff8484ffd09cdb88d461ac00745aa32c191124 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/127000 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/pdf/SkPDFDevice.cpp')
-rw-r--r--src/pdf/SkPDFDevice.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index c18219ab0d..6e36fb3d82 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1052,8 +1052,8 @@ private:
};
} // namespace
-static SkUnichar map_glyph(const std::vector<SkUnichar>& glyphToUnicode, SkGlyphID glyph) {
- return glyph < glyphToUnicode.size() ? glyphToUnicode[SkToInt(glyph)] : -1;
+static SkUnichar map_glyph(const SkTDArray<SkUnichar>& glyphToUnicode, SkGlyphID glyph) {
+ return SkToInt(glyph) < glyphToUnicode.count() ? glyphToUnicode[SkToInt(glyph)] : -1;
}
static void update_font(SkWStream* wStream, int fontIndex, SkScalar textSize) {
@@ -1200,9 +1200,6 @@ void SkPDFDevice::internalDrawText(
if (!metrics) {
return;
}
- const std::vector<SkUnichar>& glyphToUnicode = SkPDFFont::GetUnicodeMap(
- typeface, fDocument->canon());
-
SkClusterator clusterator(sourceText, sourceByteCount, paint,
clusters, textByteLength, utf8Text);
const SkGlyphID* glyphs = clusterator.glyphs();
@@ -1247,6 +1244,7 @@ void SkPDFDevice::internalDrawText(
return;
}
SkDynamicMemoryWStream* out = content.stream();
+ const SkTDArray<SkUnichar>& glyphToUnicode = metrics->fGlyphToUnicode;
out->writeText("BT\n");
SK_AT_SCOPE_EXIT(out->writeText("ET\n"));