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

Side by Side Diff: experimental/PdfViewer/src/SkPdfRenderer.cpp

Issue 68843006: Changes to SkTDStackNester. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp ('k') | experimental/PdfViewer/src/SkTDStackNester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698