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

Unified Diff: tests/PDFGlyphsToUnicodeTest.cpp

Issue 2253283004: SkPDF: in-place font subsetting (Closed) Base URL: https://skia.googlesource.com/skia.git@SkPdfCacheMetrics
Patch Set: 2016-08-18 (Thursday) 16:02:16 EDT Created 4 years, 4 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 | « tests/BitSetTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFGlyphsToUnicodeTest.cpp
diff --git a/tests/PDFGlyphsToUnicodeTest.cpp b/tests/PDFGlyphsToUnicodeTest.cpp
index b8157caeeaf66ccabae8a0c8b1a1661f15a1c630..d83ce664bcfe4cb23be4f384787bd73200edd6b1 100644
--- a/tests/PDFGlyphsToUnicodeTest.cpp
+++ b/tests/PDFGlyphsToUnicodeTest.cpp
@@ -5,12 +5,14 @@
* found in the LICENSE file.
*/
+#include "SkBitSet.h"
#include "SkData.h"
-#include "SkPDFFont.h"
#include "SkPDFMakeToUnicodeCmap.h"
#include "SkStream.h"
#include "Test.h"
+static const int kMaximumGlyphCount = SK_MaxU16 + 1;
+
static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset,
const char* buffer, size_t len) {
sk_sp<SkData> data(stream.copyToData());
@@ -26,7 +28,7 @@ static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset,
DEF_TEST(ToUnicode, reporter) {
SkTDArray<SkUnichar> glyphToUnicode;
SkTDArray<uint16_t> glyphsInSubset;
- SkPDFGlyphSet subset;
+ SkBitSet subset(kMaximumGlyphCount);
glyphToUnicode.push(0); // 0
glyphToUnicode.push(0); // 1
@@ -65,7 +67,7 @@ DEF_TEST(ToUnicode, reporter) {
glyphToUnicode.push(0x1013);
SkDynamicMemoryWStream buffer;
- subset.set(glyphsInSubset.begin(), glyphsInSubset.count());
+ subset.setAll(glyphsInSubset.begin(), glyphsInSubset.count());
SkPDFAppendCmapSections(glyphToUnicode, &subset, &buffer, true, 0, 0xFFFF);
char expectedResult[] =
@@ -136,7 +138,7 @@ endbfrange\n";
glyphToUnicode.reset();
glyphsInSubset.reset();
- SkPDFGlyphSet subset2;
+ SkBitSet subset2(kMaximumGlyphCount);
// Test mapping:
// I n s t a l
@@ -154,7 +156,7 @@ endbfrange\n";
glyphsInSubset.push(0x57);
SkDynamicMemoryWStream buffer2;
- subset2.set(glyphsInSubset.begin(), glyphsInSubset.count());
+ subset2.setAll(glyphsInSubset.begin(), glyphsInSubset.count());
SkPDFAppendCmapSections(glyphToUnicode, &subset2, &buffer2, true, 0, 0xffff);
char expectedResult2[] =
« no previous file with comments | « tests/BitSetTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698