aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc/SkDocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/SkDocument.cpp')
-rw-r--r--src/doc/SkDocument.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/doc/SkDocument.cpp b/src/doc/SkDocument.cpp
index cefe34ee85..85a2bad5e8 100644
--- a/src/doc/SkDocument.cpp
+++ b/src/doc/SkDocument.cpp
@@ -10,7 +10,7 @@
SK_DEFINE_INST_COUNT(SkDocument)
-SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*)) {
+SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*, bool)) {
fStream = stream; // we do not own this object.
fDoneProc = doneProc;
fState = kBetweenPages_State;
@@ -68,7 +68,7 @@ bool SkDocument::close() {
bool success = this->onClose(fStream);
if (fDoneProc) {
- fDoneProc(fStream);
+ fDoneProc(fStream, false);
}
// we don't own the stream, but we mark it NULL since we can
// no longer write to it.
@@ -85,5 +85,13 @@ bool SkDocument::close() {
}
void SkDocument::abort() {
+ this->onAbort();
+
fState = kClosed_State;
+ if (fDoneProc) {
+ fDoneProc(fStream, true);
+ }
+ // we don't own the stream, but we mark it NULL since we can
+ // no longer write to it.
+ fStream = NULL;
}