skip unneeded header from writeFlattenable when building font-cache-key. Saves ~30% in size
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1924033002
TBR=mtklein
Review-Url: https://codereview.chromium.org/1924033002
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 123f203..d28168a 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1567,14 +1567,14 @@
size_t descSize = sizeof(*rec);
if (pe) {
- peBuffer->writeFlattenable(pe);
+ pe->flatten(*peBuffer);
descSize += peBuffer->bytesWritten();
entryCount += 1;
rec->fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion
// seems like we could support kLCD as well at this point...
}
if (mf) {
- mfBuffer->writeFlattenable(mf);
+ mf->flatten(*mfBuffer);
descSize += mfBuffer->bytesWritten();
entryCount += 1;
rec->fMaskFormat = SkMask::kA8_Format; // force antialiasing with maskfilters
@@ -1585,7 +1585,7 @@
rec->ignorePreBlend();
}
if (ra) {
- raBuffer->writeFlattenable(ra);
+ ra->flatten(*raBuffer);
descSize += raBuffer->bytesWritten();
entryCount += 1;
rec->fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion