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

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

Issue 16660002: SkDocument base for pdf, xps, etc. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « gyp/tools.gyp ('k') | src/doc/SkDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkDocument_DEFINED
9 #define SkDocument_DEFINED
10
11 #include "SkRect.h"
12 #include "SkRefCnt.h"
13
14 class SkCanvas;
15 class SkWStream;
16
17 class SkDocument : public SkRefCnt {
epoger 2013/06/07 19:39:04 Since this is going in include/core , can you plea
reed1 2013/06/07 19:50:40 Done.
18 public:
19 static SkDocument* CreatePDF(const char filename[]);
20 static SkDocument* CreatePDF(SkWStream*);
21
22 SkCanvas* beginPage(SkScalar width, SkScalar height,
23 const SkRect* content = NULL);
24 void endPage();
25 void close();
26
27 protected:
28 SkDocument(SkWStream*);
29 virtual ~SkDocument();
30
31 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height,
32 const SkRect& content) = 0;
33 virtual void onEndPage() = 0;
34 virtual void onClose(SkWStream*) = 0;
35
36 enum State {
37 kBetweenPages_State,
38 kInPage_State,
39 kClosed_State
40 };
41 State getState() const { return fState; }
42
43 private:
44 SkWStream* fStream;
45 State fState;
46 };
47
48 #endif
OLDNEW
« no previous file with comments | « gyp/tools.gyp ('k') | src/doc/SkDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698