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

Unified Diff: src/core/SkPicture.cpp

Issue 618303002: Remove DEPRECATED_beginRecording(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up benches Created 6 years, 3 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/SkPictureRecorder.h ('k') | src/core/SkPictureRecord.cpp » ('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 def67e6571f422af37a6686b834c4d8caf715ff4..98c28e61af4189d99681e0bd00028cc4cbdf78ef 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -264,12 +264,12 @@ SkPicture::SkPicture(SkScalar width, SkScalar height,
// Create an SkPictureData-backed SkPicture from an SkRecord.
// This for compatibility with serialization code only. This is not cheap.
-static SkPicture* backport(const SkRecord& src, const SkRect& cullRect) {
- SkPictureRecorder recorder;
- SkRecordDraw(src,
- recorder.DEPRECATED_beginRecording(cullRect.width(), cullRect.height()),
- NULL/*bbh*/, NULL/*callback*/);
- return recorder.endRecording();
+SkPicture* SkPicture::Backport(const SkRecord& src, const SkRect& cullRect) {
+ SkPictureRecord rec(SkISize::Make(cullRect.width(), cullRect.height()), 0/*flags*/);
+ rec.beginRecording();
+ SkRecordDraw(src, &rec, NULL/*bbh*/, NULL/*callback*/);
+ rec.endRecording();
+ return SkNEW_ARGS(SkPicture, (cullRect.width(), cullRect.height(), rec, false/*deepCopyOps*/));
}
// fRecord OK
@@ -510,7 +510,7 @@ void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
// If we're a new-format picture, backport to old format for serialization.
SkAutoTDelete<SkPicture> oldFormat;
if (NULL == data && fRecord.get()) {
- oldFormat.reset(backport(*fRecord, this->cullRect()));
+ oldFormat.reset(Backport(*fRecord, this->cullRect()));
data = oldFormat->fData.get();
SkASSERT(data);
}
@@ -535,7 +535,7 @@ void SkPicture::flatten(SkWriteBuffer& buffer) const {
// If we're a new-format picture, backport to old format for serialization.
SkAutoTDelete<SkPicture> oldFormat;
if (NULL == data && fRecord.get()) {
- oldFormat.reset(backport(*fRecord, this->cullRect()));
+ oldFormat.reset(Backport(*fRecord, this->cullRect()));
data = oldFormat->fData.get();
SkASSERT(data);
}
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698