Skip to content

Commit 55d642d

Browse files
committed
PDFBOX-5660: optimize, as suggested by Valery Bokov; closes #224
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928031 13f79535-47bb-0310-9956-ffa450edef68
1 parent f85be6c commit 55d642d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,15 @@ public void showForm(PDFormXObject form) throws IOException
199199
protected void processSoftMask(PDTransparencyGroup group) throws IOException
200200
{
201201
saveGraphicsState();
202-
Matrix softMaskCTM = getGraphicsState().getSoftMask().getInitialTransformationMatrix();
203-
getGraphicsState().setCurrentTransformationMatrix(softMaskCTM);
204-
getGraphicsState().setTextMatrix(new Matrix());
205-
getGraphicsState().setTextLineMatrix(new Matrix());
206-
getGraphicsState().setNonStrokingColorSpace(PDDeviceGray.INSTANCE);
207-
getGraphicsState().setNonStrokingColor(PDDeviceGray.INSTANCE.getInitialColor());
208-
getGraphicsState().setStrokingColorSpace(PDDeviceGray.INSTANCE);
209-
getGraphicsState().setStrokingColor(PDDeviceGray.INSTANCE.getInitialColor());
202+
PDGraphicsState graphicsState = getGraphicsState();
203+
Matrix softMaskCTM = graphicsState.getSoftMask().getInitialTransformationMatrix();
204+
graphicsState.setCurrentTransformationMatrix(softMaskCTM);
205+
graphicsState.setTextMatrix(new Matrix());
206+
graphicsState.setTextLineMatrix(new Matrix());
207+
graphicsState.setNonStrokingColorSpace(PDDeviceGray.INSTANCE);
208+
graphicsState.setNonStrokingColor(PDDeviceGray.INSTANCE.getInitialColor());
209+
graphicsState.setStrokingColorSpace(PDDeviceGray.INSTANCE);
210+
graphicsState.setStrokingColor(PDDeviceGray.INSTANCE.getInitialColor());
210211

211212
try
212213
{

0 commit comments

Comments
 (0)