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

Unified Diff: src/core/SkPicture.cpp

Issue 352643002: Prune some dead code from SkPicture.cpp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | 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 2d054c607a5160a9fecf7d4082b280d68b30b827..a678047455fc3aab043fd8659c7b107e6105e4ba 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -438,18 +438,13 @@ void SkPicture::createHeader(SkPictInfo* info) const {
// fRecord TODO
void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
- SkPicturePlayback* playback = fPlayback.get();
-
SkPictInfo info;
this->createHeader(&info);
stream->write(&info, sizeof(info));
- if (playback) {
+
+ if (NULL != fPlayback.get()) {
stream->writeBool(true);
- playback->serialize(stream, encoder);
- // delete playback if it is a local version (i.e. cons'd up just now)
- if (playback != fPlayback.get()) {
- SkDELETE(playback);
- }
+ fPlayback->serialize(stream, encoder);
} else {
stream->writeBool(false);
}
@@ -469,18 +464,13 @@ void SkPicture::WriteTagSize(SkWStream* stream, uint32_t tag, size_t size) {
// fRecord TODO
void SkPicture::flatten(SkWriteBuffer& buffer) const {
- SkPicturePlayback* playback = fPlayback.get();
-
SkPictInfo info;
this->createHeader(&info);
buffer.writeByteArray(&info, sizeof(info));
- if (playback) {
+
+ if (NULL != fPlayback.get()) {
buffer.writeBool(true);
- playback->flatten(buffer);
- // delete playback if it is a local version (i.e. cons'd up just now)
- if (playback != fPlayback.get()) {
- SkDELETE(playback);
- }
+ fPlayback->flatten(buffer);
} else {
buffer.writeBool(false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698