Bug 1263154 - Avoid applying transform twice during PDF printing. r=Yury, a=ritu
authorYury Delendik <ydelendik@mozilla.com>
Tue, 19 Apr 2016 15:14:59 -0500
changeset 324101 4e0ea7414288b747eefd0eb0dd7e2bf225774b30
parent 324100 177a94ddc4b1dcef2fe0ca972adca94b5ab4497b
child 324102 17cf0270b19091b1a56b01ab940f66c830fe0b09
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYury, ritu
bugs1263154
milestone47.0a2
Bug 1263154 - Avoid applying transform twice during PDF printing. r=Yury, a=ritu
browser/extensions/pdfjs/content/build/pdf.js
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -4682,17 +4682,20 @@ var CanvasGraphics = (function CanvasGra
       }
     },
 
     endDrawing: function CanvasGraphics_endDrawing() {
       this.ctx.restore();
 
       if (this.transparentCanvas) {
         this.ctx = this.compositeCtx;
+        this.ctx.save();
+        this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice
         this.ctx.drawImage(this.transparentCanvas, 0, 0);
+        this.ctx.restore();
         this.transparentCanvas = null;
       }
 
       this.cachedCanvases.clear();
       WebGLUtils.clear();
 
       if (this.imageLayer) {
         this.imageLayer.endLayout();