SkPDF: refactor & code cleanup ahead of https://crrev.com/2322403002
SkPDFDevice::GraphicStateEntry: remove unnecessary fFont and
fTextSize.
SkPDFDevice::updateFont(): replace with update_font() and inlined
code. De-duplicate this block of code.
SkPDFResourceDict::GetResourceTypePrefix function made public: removes
need for temporary SkString returned by
SkPDFResourceDict::getResourceName()
GlyphPositioner: delay writing intial matrix until first glyph.
Assert that widechars is a constant.
SkPDFFont::FontType(): make public so that PDFDevice can know about
multibyte status.
SkPDFFont::countStretch() removed, and the stretch loop flattened.
*no changes in PDF output*
BUG=skia:5434
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2327953002
Review-Url: https://codereview.chromium.org/2327953002
diff --git a/src/pdf/SkPDFResourceDict.cpp b/src/pdf/SkPDFResourceDict.cpp
index b24f8a5..67e81b6 100644
--- a/src/pdf/SkPDFResourceDict.cpp
+++ b/src/pdf/SkPDFResourceDict.cpp
@@ -32,7 +32,7 @@
"Font"
};
-static char get_resource_type_prefix(
+char SkPDFResourceDict::GetResourceTypePrefix(
SkPDFResourceDict::SkPDFResourceType type) {
SkASSERT(type >= 0);
SkASSERT(type < SkPDFResourceDict::kResourceTypeCount);
@@ -50,9 +50,7 @@
SkString SkPDFResourceDict::getResourceName(
SkPDFResourceDict::SkPDFResourceType type, int key) {
- SkString keyString;
- keyString.printf("%c%d", get_resource_type_prefix(type), key);
- return keyString;
+ return SkStringPrintf("%c%d", SkPDFResourceDict::GetResourceTypePrefix(type), key);
}
static void add_subdict(