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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 2120533002: SkPDF: Fix encoding of unichr outside of basic plane (Closed) Base URL: https://skia.googlesource.com/skia.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 | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 12698dc00b012117466c1b4eb1cd00866f4516b0..7c366cdae7a6159d3605e127720b0bc263f4e295 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1063,15 +1063,9 @@ static void write_wide_string(SkDynamicMemoryWStream* wStream,
bool wideChars) {
if (wideChars) {
SkASSERT(2 * len < 65535);
- static const char gHex[] = "0123456789ABCDEF";
wStream->writeText("<");
for (size_t i = 0; i < len; i++) {
- char result[4]; // Big-endian
- result[0] = gHex[(input[i] >> 12) & 0xF];
- result[1] = gHex[(input[i] >> 8) & 0xF];
- result[2] = gHex[(input[i] >> 4) & 0xF];
- result[3] = gHex[(input[i]) & 0xF];
- wStream->write(result, 4);
+ SkPDFUtils::WriteUInt16BE(wStream, input[i]);
}
wStream->writeText(">");
} else {
« no previous file with comments | « no previous file | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698