aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFMakeToUnicodeCmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf/SkPDFMakeToUnicodeCmap.cpp')
-rw-r--r--src/pdf/SkPDFMakeToUnicodeCmap.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/pdf/SkPDFMakeToUnicodeCmap.cpp b/src/pdf/SkPDFMakeToUnicodeCmap.cpp
index afe773207d..c93aa6f2c5 100644
--- a/src/pdf/SkPDFMakeToUnicodeCmap.cpp
+++ b/src/pdf/SkPDFMakeToUnicodeCmap.cpp
@@ -147,15 +147,12 @@ static void append_bfrange_section(const SkTDArray<BFRange>& bfrange,
// For the worst case (having 65536 continuous unicode and we use every other
// one of them), the possible savings by aggressive optimization is 416KB
// pre-compressed and does not provide enough motivation for implementation.
-void SkPDFAppendCmapSections(const SkTDArray<SkUnichar>& glyphToUnicode,
+void SkPDFAppendCmapSections(const SkUnichar* glyphToUnicode,
const SkBitSet* subset,
SkDynamicMemoryWStream* cmap,
bool multiByteGlyphs,
SkGlyphID firstGlyphID,
SkGlyphID lastGlyphID) {
- if (glyphToUnicode.isEmpty()) {
- return;
- }
int glyphOffset = 0;
if (!multiByteGlyphs) {
glyphOffset = firstGlyphID - 1;
@@ -166,8 +163,7 @@ void SkPDFAppendCmapSections(const SkTDArray<SkUnichar>& glyphToUnicode,
BFRange currentRangeEntry = {0, 0, 0};
bool rangeEmpty = true;
- const int limit =
- SkMin32(lastGlyphID + 1, glyphToUnicode.count()) - glyphOffset;
+ const int limit = (int)lastGlyphID + 1 - glyphOffset;
for (int i = firstGlyphID - glyphOffset; i < limit + 1; ++i) {
bool inSubset = i < limit &&
@@ -210,7 +206,7 @@ void SkPDFAppendCmapSections(const SkTDArray<SkUnichar>& glyphToUnicode,
}
sk_sp<SkPDFStream> SkPDFMakeToUnicodeCmap(
- const SkTDArray<SkUnichar>& glyphToUnicode,
+ const SkUnichar* glyphToUnicode,
const SkBitSet* subset,
bool multiByteGlyphs,
SkGlyphID firstGlyphID,