OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkDocument.h" | 8 #include "SkDocument.h" |
9 #include "SkStream.h" | 9 #include "SkStream.h" |
10 | 10 |
11 SK_DEFINE_INST_COUNT(SkDocument) | |
12 | |
13 SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*, bool)) { | 11 SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*, bool)) { |
14 fStream = stream; // we do not own this object. | 12 fStream = stream; // we do not own this object. |
15 fDoneProc = doneProc; | 13 fDoneProc = doneProc; |
16 fState = kBetweenPages_State; | 14 fState = kBetweenPages_State; |
17 } | 15 } |
18 | 16 |
19 SkDocument::~SkDocument() { | 17 SkDocument::~SkDocument() { |
20 this->close(); | 18 this->close(); |
21 } | 19 } |
22 | 20 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 this->onAbort(); | 86 this->onAbort(); |
89 | 87 |
90 fState = kClosed_State; | 88 fState = kClosed_State; |
91 if (fDoneProc) { | 89 if (fDoneProc) { |
92 fDoneProc(fStream, true); | 90 fDoneProc(fStream, true); |
93 } | 91 } |
94 // we don't own the stream, but we mark it NULL since we can | 92 // we don't own the stream, but we mark it NULL since we can |
95 // no longer write to it. | 93 // no longer write to it. |
96 fStream = NULL; | 94 fStream = NULL; |
97 } | 95 } |
OLD | NEW |