OLD | NEW |
1 #ifndef __DEFINED__SkPdfBasics | 1 #ifndef __DEFINED__SkPdfBasics |
2 #define __DEFINED__SkPdfBasics | 2 #define __DEFINED__SkPdfBasics |
3 | 3 |
4 #include "SkCanvas.h" | 4 #include "SkCanvas.h" |
5 #include "SkPaint.h" | 5 #include "SkPaint.h" |
6 #include "SkPdfConfig.h" | 6 #include "SkPdfConfig.h" |
7 #include "SkPdfUtils.h" | 7 #include "SkPdfUtils.h" |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 fBlendModes[0] = SkXfermode::kSrc_Mode; // PDF: Normal Blend mode | 352 fBlendModes[0] = SkXfermode::kSrc_Mode; // PDF: Normal Blend mode |
353 fSMask = NULL; | 353 fSMask = NULL; |
354 } | 354 } |
355 | 355 |
356 // TODO(edisonn): make two functons instead, stroking and non stoking, avoid
branching | 356 // TODO(edisonn): make two functons instead, stroking and non stoking, avoid
branching |
357 void applyGraphicsState(SkPaint* paint, bool stroking); | 357 void applyGraphicsState(SkPaint* paint, bool stroking); |
358 }; | 358 }; |
359 | 359 |
360 // TODO(edisonn): better class design. | 360 // TODO(edisonn): better class design. |
361 // TODO(edisonn): rename to SkPdfContext | 361 // TODO(edisonn): rename to SkPdfContext |
362 struct SkPdfContext { | 362 class SkPdfContext { |
363 std::stack<SkPdfNativeObject*> fObjectStack; | 363 public: |
| 364 std::stack<SkPdfNativeObject*> fObjectStack; |
364 std::stack<SkPdfGraphicsState> fStateStack; | 365 std::stack<SkPdfGraphicsState> fStateStack; |
365 SkPdfGraphicsState fGraphicsState; | 366 SkPdfGraphicsState fGraphicsState; |
366 SkPdfNativeDoc* fPdfDoc; | 367 SkPdfNativeDoc* fPdfDoc; |
367 // TODO(edisonn): the allocator, could be freed after the page is done drawi
ng. | 368 // TODO(edisonn): the allocator, could be freed after the page is done drawi
ng. |
368 SkPdfAllocator* fTmpPageAllocator; | 369 SkPdfAllocator* fTmpPageAllocator; |
369 SkMatrix fOriginalMatrix; | 370 SkMatrix fOriginalMatrix; |
370 | 371 |
371 SkPdfContext(SkPdfNativeDoc* doc); | 372 SkPdfContext(SkPdfNativeDoc* doc); |
372 ~SkPdfContext(); | 373 ~SkPdfContext(); |
373 }; | 374 }; |
374 | 375 |
375 #endif // __DEFINED__SkPdfBasics | 376 #endif // __DEFINED__SkPdfBasics |
OLD | NEW |