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 SkPdfGraphicsState_DEFINED | 8 #ifndef SkPdfGraphicsState_DEFINED |
9 #define SkPdfGraphicsState_DEFINED | 9 #define SkPdfGraphicsState_DEFINED |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 Rec* next = rec->fNext; | 51 Rec* next = rec->fNext; |
52 delete rec; | 52 delete rec; |
53 rec = next; | 53 rec = next; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 int count() const { return fLocalCount; } | 57 int count() const { return fLocalCount; } |
58 int depth() const { return fLocalCount; } | 58 int depth() const { return fLocalCount; } |
59 bool empty() const { return fLocalCount == 0; } | 59 bool empty() const { return fLocalCount == 0; } |
60 | 60 |
61 bool nests() { | 61 int nests() { |
62 return fNestingLevel; | 62 return fNestingLevel; |
63 } | 63 } |
64 | 64 |
65 void nest() { | 65 void nest() { |
66 // We are are past max nesting levels, we will still continue to work, b
ut we might fail | 66 // We are are past max nesting levels, we will still continue to work, b
ut we might fail |
67 // to properly ignore errors. Ideally it should only mean poor rendering
in exceptional | 67 // to properly ignore errors. Ideally it should only mean poor rendering
in exceptional |
68 // cases | 68 // cases |
69 if (fNestingLevel >= 0 && fNestingLevel < MAX_NESTING) { | 69 if (fNestingLevel >= 0 && fNestingLevel < MAX_NESTING) { |
70 fNestings[fNestingLevel] = fLocalCount; | 70 fNestings[fNestingLevel] = fLocalCount; |
71 fLocalCount = 0; | 71 fLocalCount = 0; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 SkPdfGraphicsState fGraphicsState; | 505 SkPdfGraphicsState fGraphicsState; |
506 SkPdfNativeDoc* fPdfDoc; | 506 SkPdfNativeDoc* fPdfDoc; |
507 SkPdfAllocator* fTmpPageAllocator; | 507 SkPdfAllocator* fTmpPageAllocator; |
508 SkMatrix fOriginalMatrix; | 508 SkMatrix fOriginalMatrix; |
509 | 509 |
510 SkPdfContext(SkPdfNativeDoc* doc); | 510 SkPdfContext(SkPdfNativeDoc* doc); |
511 ~SkPdfContext(); | 511 ~SkPdfContext(); |
512 }; | 512 }; |
513 | 513 |
514 #endif // SkPdfGraphicsState_DEFINED | 514 #endif // SkPdfGraphicsState_DEFINED |
OLD | NEW |