]> git.parisson.com Git - pdf.js.git/commitdiff
Fixed up excess code
authorsbarman <sbarman@L3CWZ5T.(none)>
Fri, 10 Jun 2011 02:34:34 +0000 (19:34 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Fri, 10 Jun 2011 02:34:34 +0000 (19:34 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index c05ff40c4fd191456c1000b45bf1979ed67b94f1..2ba25c221f2c097ecac370307046bcb2f5e55ac9 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -1953,8 +1953,9 @@ var CanvasGraphics = (function() {
             if (w < 1 || h < 1)
                 error("Invalid image width or height");
             
+            var ctx = this.ctx;
             // scale the image to the unit square
-            this.ctx.scale(1/w, 1/h);
+            ctx.scale(1/w, 1/h);
 
             var interpolate = dict.get2("Interpolate", "I");
             if (!IsBool(interpolate))
@@ -1997,9 +1998,9 @@ var CanvasGraphics = (function() {
             TODO("create color map");
             
             var mask = image.dict.get("Mask");
-            mask = this.xref.fetchIfRef(mask);
+            mask = xref.fetchIfRef(mask);
             var smask = image.dict.get("SMask");
-            smask = this.xref.fetchIfRef(smask);
+            smask = xref.fetchIfRef(smask);
 
             if (IsStream(smask)) {
                 if (inline)
@@ -2038,10 +2039,7 @@ var CanvasGraphics = (function() {
             var tmpCanvas = document.createElement("canvas");
             tmpCanvas.width = w;
             tmpCanvas.height = h;
-            var ctx = this.ctx;
             var tmpCtx = tmpCanvas.getContext("2d");
-            tmpCtx.fillStyle = "rgb(255, 255, 255)";
-            tmpCtx.fillRect(0, 0, w, h);
             var imgData = tmpCtx.getImageData(0, 0, w, h);
             var pixels = imgData.data;
             
@@ -2110,7 +2108,7 @@ var CanvasGraphics = (function() {
                 }
             }
             tmpCtx.putImageData(imgData, 0, 0);
-            this.ctx.drawImage(tmpCanvas, 0, 0);
+            ctx.drawImage(tmpCanvas, 0, 0);
             this.restore();
         },