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

Side by Side Diff: include/core/SkDocument.h

Issue 691783002: Add SkDocument::getStream() method. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SkDocument_DEFINED 8 #ifndef SkDocument_DEFINED
9 #define SkDocument_DEFINED 9 #define SkDocument_DEFINED
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // note: subclasses must call close() in their destructor, as the base class 115 // note: subclasses must call close() in their destructor, as the base class
116 // cannot do this for them. 116 // cannot do this for them.
117 virtual ~SkDocument(); 117 virtual ~SkDocument();
118 118
119 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height, 119 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height,
120 const SkRect& content) = 0; 120 const SkRect& content) = 0;
121 virtual void onEndPage() = 0; 121 virtual void onEndPage() = 0;
122 virtual bool onClose(SkWStream*) = 0; 122 virtual bool onClose(SkWStream*) = 0;
123 virtual void onAbort() = 0; 123 virtual void onAbort() = 0;
124 124
125 // Allows subclasses to write to the stream as pages are written.
126 SkWStream* getStream() { return fStream; }
127
125 enum State { 128 enum State {
126 kBetweenPages_State, 129 kBetweenPages_State,
127 kInPage_State, 130 kInPage_State,
128 kClosed_State 131 kClosed_State
129 }; 132 };
130 State getState() const { return fState; } 133 State getState() const { return fState; }
131 134
132 private: 135 private:
133 SkWStream* fStream; 136 SkWStream* fStream;
134 void (*fDoneProc)(SkWStream*, bool aborted); 137 void (*fDoneProc)(SkWStream*, bool aborted);
135 State fState; 138 State fState;
136 139
137 typedef SkRefCnt INHERITED; 140 typedef SkRefCnt INHERITED;
138 }; 141 };
139 142
140 #endif 143 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698