[Pkg-javascript-commits] [pdf.js] 27/141: Balance smask process	chunking
    David Prévot 
    taffit at moszumanska.debian.org
       
    Sat Apr 19 22:40:26 UTC 2014
    
    
  
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 944219ad8a80cd8df9182b478eb22c258523f64d
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Thu Feb 13 08:37:19 2014 -0600
    Balance smask process chunking
---
 src/display/canvas.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/display/canvas.js b/src/display/canvas.js
index 96ba5b8..e7a29af 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -652,7 +652,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
     }
 
     // processing image in chunks to save memory
-    var chunkSize = 16;
+    var PIXELS_TO_PROCESS = 65536;
+    var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));
     for (var row = 0; row < height; row += chunkSize) {
       var chunkHeight = Math.min(chunkSize, height - row);
       var maskData = maskCtx.getImageData(0, row, width, chunkHeight);
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
    
    
More information about the Pkg-javascript-commits
mailing list