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

Unified Diff: src/core/SkPicture.cpp

Issue 1918433002: Optionally enable SkValidatingReadBuffer in SkPictureImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More clean up Created 4 years, 8 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/SkPicturePlayback.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 c7e5e524b038e8d5fdf0f7fdbfc87f6ba7ed9429..dfedd141db0f85a08b5c2e1bffb62fe95c83e80c 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -129,13 +129,15 @@ bool SkPicture::InternalOnly_BufferIsSKP(SkReadBuffer* buffer, SkPictInfo* pInfo
return false;
}
-sk_sp<SkPicture> SkPicture::Forwardport(const SkPictInfo& info, const SkPictureData* data) {
+sk_sp<SkPicture> SkPicture::Forwardport(const SkPictInfo& info,
+ const SkPictureData* data,
+ const SkReadBuffer* buffer) {
if (!data) {
return nullptr;
}
SkPicturePlayback playback(data);
SkPictureRecorder r;
- playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/);
+ playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/, buffer);
return r.finishRecordingAsPicture();
}
@@ -161,7 +163,7 @@ sk_sp<SkPicture> SkPicture::MakeFromStream(SkStream* stream, InstallPixelRefProc
}
SkAutoTDelete<SkPictureData> data(
SkPictureData::CreateFromStream(stream, info, proc, typefaces));
- return Forwardport(info, data);
+ return Forwardport(info, data, nullptr);
}
sk_sp<SkPicture> SkPicture::MakeFromBuffer(SkReadBuffer& buffer) {
@@ -170,7 +172,7 @@ sk_sp<SkPicture> SkPicture::MakeFromBuffer(SkReadBuffer& buffer) {
return nullptr;
}
SkAutoTDelete<SkPictureData> data(SkPictureData::CreateFromBuffer(buffer, info));
- return Forwardport(info, data);
+ return Forwardport(info, data, &buffer);
}
SkPictureData* SkPicture::backport() const {
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698