| 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 #include "SkPdfRenderer.h" | 8 #include "SkPdfRenderer.h" |
| 9 | 9 |
| 10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 pdfContext->fObjectStack.nest(); | 1126 pdfContext->fObjectStack.nest(); |
| 1127 return kOK_SkPdfResult; | 1127 return kOK_SkPdfResult; |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 SkPdfResult PdfOp_Q(SkPdfContext* pdfContext, SkCanvas* canvas, PdfTokenLooper**
looper) { | 1130 SkPdfResult PdfOp_Q(SkPdfContext* pdfContext, SkCanvas* canvas, PdfTokenLooper**
looper) { |
| 1131 if (pdfContext->fStateStack.count() > 0) { | 1131 if (pdfContext->fStateStack.count() > 0) { |
| 1132 pdfContext->fGraphicsState = pdfContext->fStateStack.top(); | 1132 pdfContext->fGraphicsState = pdfContext->fStateStack.top(); |
| 1133 pdfContext->fStateStack.pop(); | 1133 pdfContext->fStateStack.pop(); |
| 1134 canvas->restore(); | 1134 canvas->restore(); |
| 1135 | 1135 |
| 1136 if (pdfContext->fObjectStack.nests() == 0) { | 1136 if (pdfContext->fObjectStack.nestingLevel() == 0) { |
| 1137 SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kStackNestingOverflow_S
kPdfIssue, | 1137 SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kStackNestingOverflow_S
kPdfIssue, |
| 1138 "stack nesting overflow (q/Q)", NULL, pdfContext); | 1138 "stack nesting overflow (q/Q)", NULL, pdfContext); |
| 1139 return kIgnoreError_SkPdfResult; | 1139 return kIgnoreError_SkPdfResult; |
| 1140 } else { | 1140 } else { |
| 1141 pdfContext->fObjectStack.unnest(); | 1141 pdfContext->fObjectStack.unnest(); |
| 1142 } | 1142 } |
| 1143 } else { | 1143 } else { |
| 1144 SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kStackOverflow_SkPdfIssue, | 1144 SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kStackOverflow_SkPdfIssue, |
| 1145 "stack overflow (q/Q)", NULL, pdfContext); | 1145 "stack overflow (q/Q)", NULL, pdfContext); |
| 1146 return kIgnoreError_SkPdfResult; | 1146 return kIgnoreError_SkPdfResult; |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3150 | 3150 |
| 3151 rect = SkRect::MakeWH(width, height); | 3151 rect = SkRect::MakeWH(width, height); |
| 3152 | 3152 |
| 3153 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); | 3153 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); |
| 3154 | 3154 |
| 3155 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); | 3155 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); |
| 3156 SkCanvas canvas(device); | 3156 SkCanvas canvas(device); |
| 3157 | 3157 |
| 3158 return renderer->renderPage(page, &canvas, rect); | 3158 return renderer->renderPage(page, &canvas, rect); |
| 3159 } | 3159 } |
| OLD | NEW |