SkPDF: maybe save some RAM by making the bitsets smaller
Wrap SkBitSet in a thin SkPDFGlyphUse class that manages new mapping.
Change-Id: Id97d42b8961f49c93fd45fdefad69d0aa9e273c5
Reviewed-on: https://skia-review.googlesource.com/c/163882
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/tests/PDFGlyphsToUnicodeTest.cpp b/tests/PDFGlyphsToUnicodeTest.cpp
index 2aa52f8..71d75dd 100644
--- a/tests/PDFGlyphsToUnicodeTest.cpp
+++ b/tests/PDFGlyphsToUnicodeTest.cpp
@@ -15,7 +15,7 @@
#include "SkStream.h"
#include "SkTo.h"
-static const int kMaximumGlyphCount = UINT16_MAX + 1;
+static constexpr SkGlyphID kMaximumGlyphIndex = UINT16_MAX;
static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset,
const char* buffer, size_t len) {
@@ -37,7 +37,7 @@
DEF_TEST(SkPDF_ToUnicode, reporter) {
SkTDArray<SkUnichar> glyphToUnicode;
SkTDArray<uint16_t> glyphsInSubset;
- SkBitSet subset(kMaximumGlyphCount);
+ SkPDFGlyphUse subset(1, kMaximumGlyphIndex);
glyphToUnicode.push_back(0); // 0
glyphToUnicode.push_back(0); // 1
@@ -155,7 +155,7 @@
glyphToUnicode.reset();
glyphsInSubset.reset();
- SkBitSet subset2(kMaximumGlyphCount);
+ SkPDFGlyphUse subset2(1, kMaximumGlyphIndex);
// Test mapping:
// I n s t a l