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

Unified Diff: src/core/SkReadBuffer.cpp

Issue 1855733002: change flattenable factory to return sk_sp (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/SkReadBuffer.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkReadBuffer.cpp
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index 2dd9f093ac2be7e21da632f84e7f03cc15bbc0c7..f220b5a9e61581b35772b5514c1c6fd307e56d8d 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -356,7 +356,7 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
// if we get here, factory may still be null, but if that is the case, the
// failure was ours, not the writer.
- SkFlattenable* obj = nullptr;
+ sk_sp<SkFlattenable> obj;
uint32_t sizeRecorded = fReader.readU32();
if (factory) {
size_t offset = fReader.offset();
@@ -371,7 +371,7 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
// we must skip the remaining data
fReader.skip(sizeRecorded);
}
- return obj;
+ return obj.release();
}
/**
« no previous file with comments | « src/core/SkReadBuffer.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698