aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-29 12:03:53 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-29 12:03:53 -0800
commit4f358fc269077219c18f30f4752e3678a15c222a (patch)
tree39640dc32fb95eefc5b56e5bc28b35d16ab8bf55 /include
parent648238cc900994de79c9e7d17f755661222aa52f (diff)
Make SkWriter32::snapshotAsData() a dumb copy.
SkWriter32::snapshotAsData() is no longer performance critical. It's only used when we're serializing to disk. BUG=skia:2289 Review URL: https://codereview.chromium.org/875403005
Diffstat (limited to 'include')
-rw-r--r--include/core/SkWriter32.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index fd24ba9ddf..a7cfbdc651 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.
};
/**