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

Unified Diff: src/core/SkPictureData.cpp

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « src/core/SkPictureData.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureData.cpp
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index fcc9706565622b5b1926b16748c1d4dc3c112647..0ba28b97e341a3c9a2db08e18bc2888ebea36087 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -93,13 +93,10 @@ void SkPictureData::init() {
fTextBlobCount = 0;
fImageRefs = nullptr;
fImageCount = 0;
- fOpData = nullptr;
fFactoryPlayback = nullptr;
}
SkPictureData::~SkPictureData() {
- SkSafeUnref(fOpData);
-
for (int i = 0; i < fPictureCount; i++) {
fPictureRefs[i]->unref();
}
@@ -358,7 +355,7 @@ bool SkPictureData::parseStreamTag(SkStream* stream,
switch (tag) {
case SK_PICT_READER_TAG:
SkASSERT(nullptr == fOpData);
- fOpData = SkData::NewFromStream(stream, size);
+ fOpData = SkData::MakeFromStream(stream, size);
if (!fOpData) {
return false;
}
@@ -529,13 +526,13 @@ bool SkPictureData::parseBufferTag(SkReadBuffer& buffer, uint32_t tag, uint32_t
}
break;
case SK_PICT_READER_TAG: {
- SkAutoDataUnref data(SkData::NewUninitialized(size));
+ auto data(SkData::MakeUninitialized(size));
if (!buffer.readByteArray(data->writable_data(), size) ||
!buffer.validate(nullptr == fOpData)) {
return false;
}
SkASSERT(nullptr == fOpData);
- fOpData = data.detach();
+ fOpData = std::move(data);
} break;
case SK_PICT_PICTURE_TAG:
if (!new_array_from_buffer(buffer, size, &fPictureRefs, &fPictureCount,
« no previous file with comments | « src/core/SkPictureData.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698