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

Unified Diff: include/core/SkWriter32.h

Issue 875403005: Make SkWriter32::snapshotAsData() a dumb copy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkWriter32.h
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index fd24ba9ddf9806b03fb67c951c4023081e84785e..a7cfbdc65142dca2944cab674a2a5822192760fc 100644
--- a/include/core/SkWriter32.h
+++ b/include/core/SkWriter32.h
@@ -45,7 +45,6 @@ public:
SkASSERT(SkIsAlign4((uintptr_t)external));
SkASSERT(SkIsAlign4(externalBytes));
- fSnapshot.reset(NULL);
fData = (uint8_t*)external;
fCapacity = externalBytes;
fUsed = 0;
@@ -89,7 +88,6 @@ public:
void overwriteTAt(size_t offset, const T& value) {
SkASSERT(SkAlign4(offset) == offset);
SkASSERT(offset < fUsed);
- SkASSERT(fSnapshot.get() == NULL);
*(T*)(fData + offset) = value;
}
@@ -235,14 +233,6 @@ public:
/**
* Captures a snapshot of the data as it is right now, and return it.
- * Multiple calls without intervening writes may return the same SkData,
- * but this is not guaranteed.
- * Future appends will not affect the returned buffer.
- * It is illegal to call overwriteTAt after this without an intervening
- * append. It may cause the snapshot buffer to be corrupted.
- * Callers must unref the returned SkData.
- * This is not thread safe, it should only be called on the writing thread,
- * the result however can be shared across threads.
*/
SkData* snapshotAsData() const;
private:
@@ -253,7 +243,6 @@ private:
size_t fUsed; // Number of bytes written.
void* fExternal; // Unmanaged memory block.
SkAutoTMalloc<uint8_t> fInternal; // Managed memory block.
- SkAutoTUnref<SkData> fSnapshot; // Holds the result of last asData.
};
/**
« no previous file with comments | « no previous file | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698