| 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 #ifndef SkPdfContext_DEFINED | 8 #ifndef SkPdfContext_DEFINED |
| 9 #define SkPdfContext_DEFINED | 9 #define SkPdfContext_DEFINED |
| 10 | 10 |
| 11 #include "SkMatrix.h" | 11 #include "SkMatrix.h" |
| 12 #include "SkPdfGraphicsState.h" | 12 #include "SkPdfGraphicsState.h" |
| 13 #include "SkPdfNativeTokenizer.h" | 13 #include "SkPdfNativeTokenizer.h" |
| 14 #include "SkTDStackNester.h" | 14 #include "SkTDStackNester.h" |
| 15 #include "SkTypes.h" | 15 #include "SkTypes.h" |
| 16 | 16 |
| 17 class SkCanvas; | 17 class SkCanvas; |
| 18 class SkPdfNativeDoc; | 18 class SkPdfNativeDoc; |
| 19 class SkPdfNativeObject; | 19 class SkPdfNativeObject; |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * The context of the drawing. The document we draw from, the current stack of | 22 * The context of the drawing. The document we draw from, the current stack of |
| 23 * objects, ... | 23 * objects, ... |
| 24 */ | 24 */ |
| 25 class SkPdfContext : public SkNoncopyable { | 25 class SkPdfContext : SkNoncopyable { |
| 26 public: | 26 public: |
| 27 // FIXME (scroggo): Add functions for accessing these. | 27 // FIXME (scroggo): Add functions for accessing these. |
| 28 SkTDStackNester<SkPdfNativeObject*> fObjectStack; | 28 SkTDStackNester<SkPdfNativeObject*> fObjectStack; |
| 29 SkTDStackNester<SkPdfGraphicsState> fStateStack; | 29 SkTDStackNester<SkPdfGraphicsState> fStateStack; |
| 30 SkPdfGraphicsState fGraphicsState; | 30 SkPdfGraphicsState fGraphicsState; |
| 31 SkPdfNativeDoc* fPdfDoc; | 31 SkPdfNativeDoc* fPdfDoc; |
| 32 SkMatrix fOriginalMatrix; | 32 SkMatrix fOriginalMatrix; |
| 33 | 33 |
| 34 // Does not take ownership of the doc. | 34 // Does not take ownership of the doc. |
| 35 explicit SkPdfContext(SkPdfNativeDoc* doc); | 35 explicit SkPdfContext(SkPdfNativeDoc* doc); |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Parse the stream and draw its commands to the canvas. | 38 * Parse the stream and draw its commands to the canvas. |
| 39 * FIXME (scroggo): May not be the best place for this, but leaving here | 39 * FIXME (scroggo): May not be the best place for this, but leaving here |
| 40 * for now, since it uses SkPdfContext's members. | 40 * for now, since it uses SkPdfContext's members. |
| 41 */ | 41 */ |
| 42 void parseStream(SkPdfNativeObject* stream, SkCanvas* canvas); | 42 void parseStream(SkPdfNativeObject* stream, SkCanvas* canvas); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 // FIXME (scroggo): Is this the right place for the allocator? | 45 // FIXME (scroggo): Is this the right place for the allocator? |
| 46 SkPdfAllocator fTmpPageAllocator; | 46 SkPdfAllocator fTmpPageAllocator; |
| 47 }; | 47 }; |
| 48 #endif // SkPdfContext_DEFINED | 48 #endif // SkPdfContext_DEFINED |
| OLD | NEW |