pdfviewer: remove save/restore used with q/Q operators (we already do there save and restore)

Review URL: https://codereview.chromium.org/22678003

git-svn-id: http://skia.googlecode.com/svn/trunk@10636 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
edisonn@google.com 2013-08-08 11:40:26 +00:00
parent 641a249196
commit 16291e51d5

View File

@ -725,8 +725,6 @@ static PdfResult doXObject_Form(PdfContext* pdfContext, SkCanvas* canvas, SkPdfT
PdfOp_q(pdfContext, canvas, NULL); PdfOp_q(pdfContext, canvas, NULL);
canvas->save();
if (skobj->Resources(pdfContext->fPdfDoc)) { if (skobj->Resources(pdfContext->fPdfDoc)) {
pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc); pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc);
@ -777,7 +775,6 @@ static PdfResult doXObject_Form(PdfContext* pdfContext, SkCanvas* canvas, SkPdfT
canvas->restore(); canvas->restore();
} }
canvas->restore();
PdfOp_Q(pdfContext, canvas, NULL); PdfOp_Q(pdfContext, canvas, NULL);
return kPartial_PdfResult; return kPartial_PdfResult;
} }
@ -795,8 +792,6 @@ static PdfResult doXObject_Pattern(PdfContext* pdfContext, SkCanvas* canvas, SkP
PdfOp_q(pdfContext, canvas, NULL); PdfOp_q(pdfContext, canvas, NULL);
canvas->save();
if (skobj->Resources(pdfContext->fPdfDoc)) { if (skobj->Resources(pdfContext->fPdfDoc)) {
pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc); pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc);
@ -832,7 +827,6 @@ static PdfResult doXObject_Pattern(PdfContext* pdfContext, SkCanvas* canvas, SkP
// TODO(edisonn): should we restore the variable stack at the same state? // TODO(edisonn): should we restore the variable stack at the same state?
// There could be operands left, that could be consumed by a parent tokenizer when we pop. // There could be operands left, that could be consumed by a parent tokenizer when we pop.
canvas->restore();
PdfOp_Q(pdfContext, canvas, NULL); PdfOp_Q(pdfContext, canvas, NULL);
return kPartial_PdfResult; return kPartial_PdfResult;
} }
@ -848,7 +842,6 @@ PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, const SkPdfObjec
} }
PdfOp_q(pdfContext, canvas, NULL); PdfOp_q(pdfContext, canvas, NULL);
canvas->save();
pdfContext->fGraphicsState.fMatrixTm.preConcat(matrix); pdfContext->fGraphicsState.fMatrixTm.preConcat(matrix);
pdfContext->fGraphicsState.fMatrixTm.preScale(SkDoubleToScalar(textSize), SkDoubleToScalar(textSize)); pdfContext->fGraphicsState.fMatrixTm.preScale(SkDoubleToScalar(textSize), SkDoubleToScalar(textSize));
@ -883,7 +876,6 @@ PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, const SkPdfObjec
// TODO(edisonn): should we restore the variable stack at the same state? // TODO(edisonn): should we restore the variable stack at the same state?
// There could be operands left, that could be consumed by a parent tokenizer when we pop. // There could be operands left, that could be consumed by a parent tokenizer when we pop.
canvas->restore();
PdfOp_Q(pdfContext, canvas, NULL); PdfOp_Q(pdfContext, canvas, NULL);
return kPartial_PdfResult; return kPartial_PdfResult;
@ -1284,7 +1276,6 @@ static PdfResult PdfOp_fillAndStroke(PdfContext* pdfContext, SkCanvas* canvas, b
// TODO(edisonn): we can use a shader here, like imageshader to draw fast. ultimately, // TODO(edisonn): we can use a shader here, like imageshader to draw fast. ultimately,
// if this is not possible, and we are in rasper mode, and the cells don't intersect, we could even have multiple cpus. // if this is not possible, and we are in rasper mode, and the cells don't intersect, we could even have multiple cpus.
canvas->save();
PdfOp_q(pdfContext, canvas, NULL); PdfOp_q(pdfContext, canvas, NULL);
if (evenOdd) { if (evenOdd) {
@ -1340,7 +1331,6 @@ static PdfResult PdfOp_fillAndStroke(PdfContext* pdfContext, SkCanvas* canvas, b
// get xstep, y step, bbox ... for cliping, and bos of the path // get xstep, y step, bbox ... for cliping, and bos of the path
PdfOp_Q(pdfContext, canvas, NULL); PdfOp_Q(pdfContext, canvas, NULL);
canvas->restore();
} else { } else {
paint.setStyle(SkPaint::kFill_Style); paint.setStyle(SkPaint::kFill_Style);
if (evenOdd) { if (evenOdd) {