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

Unified Diff: src/core/SkPicture.cpp

Issue 1233953004: Deduplicate typefaces across sub-pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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 | « include/core/SkPicture.h ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 02d495e4c6955d9a5308ee46e0e6c8a0aa52f521..26ec76184edcce8e0c74866752330897b0016bae 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -139,11 +139,18 @@ SkPicture* SkPicture::Forwardport(const SkPictInfo& info, const SkPictureData* d
}
SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc proc) {
+ return CreateFromStream(stream, proc, nullptr);
+}
+
+SkPicture* SkPicture::CreateFromStream(SkStream* stream,
+ InstallPixelRefProc proc,
+ SkTypefacePlayback* typefaces) {
SkPictInfo info;
if (!InternalOnly_StreamIsSKP(stream, &info) || !stream->readBool()) {
return nullptr;
}
- SkAutoTDelete<SkPictureData> data(SkPictureData::CreateFromStream(stream, info, proc));
+ SkAutoTDelete<SkPictureData> data(
+ SkPictureData::CreateFromStream(stream, info, proc, typefaces));
return Forwardport(info, data);
}
@@ -166,13 +173,19 @@ SkPictureData* SkPicture::backport() const {
}
void SkPicture::serialize(SkWStream* stream, SkPixelSerializer* pixelSerializer) const {
+ this->serialize(stream, pixelSerializer, nullptr);
+}
+
+void SkPicture::serialize(SkWStream* stream,
+ SkPixelSerializer* pixelSerializer,
+ SkRefCntSet* typefaceSet) const {
SkPictInfo info = this->createHeader();
SkAutoTDelete<SkPictureData> data(this->backport());
stream->write(&info, sizeof(info));
if (data) {
stream->writeBool(true);
- data->serialize(stream, pixelSerializer);
+ data->serialize(stream, pixelSerializer, typefaceSet);
} else {
stream->writeBool(false);
}
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698