move SkArenaAlloc reset to its own class
SkArenaAlloc has three fields that are used only for reset. Make a
subclass called SkArenaAllocWithReset which has the three
fields, and has the reset functionality.
An example of a reset() that is used instead of using a better scope
is PathOpsAngleAfter in PathOpsAngleTest.cpp.
Change-Id: Ie1965d128dfb7df9e022f4d18460d3f75f33e1a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307348
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/xml/SkDOM.cpp b/src/xml/SkDOM.cpp
index feee5a8..3300090 100644
--- a/src/xml/SkDOM.cpp
+++ b/src/xml/SkDOM.cpp
@@ -189,7 +189,7 @@
class SkDOMParser : public SkXMLParser {
public:
- SkDOMParser(SkArenaAlloc* chunk) : SkXMLParser(&fParserError), fAlloc(chunk) {
+ SkDOMParser(SkArenaAllocWithReset* chunk) : SkXMLParser(&fParserError), fAlloc(chunk) {
fAlloc->reset();
fRoot = nullptr;
fLevel = 0;
@@ -283,7 +283,7 @@
}
SkTDArray<SkDOM::Node*> fParentStack;
- SkArenaAlloc* fAlloc;
+ SkArenaAllocWithReset* fAlloc;
SkDOM::Node* fRoot;
bool fNeedToFlush;