From c48f85621fec172d2a035e5e5626f264e7332a6a Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 5 Oct 2011 09:18:20 -0700 Subject: [PATCH 1/5] Fixing bounding boxes and test ref file writing. --- pdf.js | 6 ++++-- test/test.py | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pdf.js b/pdf.js index 1aa1f3e60..8cb1a062e 100644 --- a/pdf.js +++ b/pdf.js @@ -5600,7 +5600,9 @@ var CanvasGraphics = (function canvasGraphics() { var bbox = stream.dict.get('BBox'); if (bbox && isArray(bbox) && 4 == bbox.length) { - this.rectangle.apply(this, bbox); + var width = bbox[2] - bbox[0]; + var height = bbox[3] - bbox[1]; + this.rectangle(bbox[0], bbox[1], width, height); this.clip(); this.endPath(); } @@ -6355,7 +6357,7 @@ var TilingPattern = (function tilingPattern() { graphics.transform.apply(graphics, tmpTranslate); if (bbox && isArray(bbox) && 4 == bbox.length) { - graphics.rectangle.apply(graphics, bbox); + graphics.rectangle(bbox[0], bbox[1], width, height); graphics.clip(); graphics.endPath(); } diff --git a/test/test.py b/test/test.py index 313a5e03a..1fb2e72c8 100644 --- a/test/test.py +++ b/test/test.py @@ -435,9 +435,9 @@ def checkEq(task, results, browser, masterMode): # NB: this follows the format of Mozilla reftest # output so that we can reuse its reftest-analyzer # script - print >>eqLog, 'REFTEST TEST-UNEXPECTED-FAIL |', browser +'-'+ taskId +'-page'+ str(page + 1), '| image comparison (==)' - print >>eqLog, 'REFTEST IMAGE 1 (TEST):', snapshot - print >>eqLog, 'REFTEST IMAGE 2 (REFERENCE):', ref + eqLog.write('REFTEST TEST-UNEXPECTED-FAIL | ' + browser +'-'+ taskId +'-page'+ str(page + 1) + ' | image comparison (==)\n') + eqLog.write('REFTEST IMAGE 1 (TEST): ' + snapshot + '\n') + eqLog.write('REFTEST IMAGE 2 (REFERENCE): ' + ref + '\n') passed = False State.numEqFailures += 1 @@ -456,7 +456,8 @@ def checkEq(task, results, browser, masterMode): if passed: print 'TEST-PASS | eq test', task['id'], '| in', browser - + if State.eqLog: + State.eqLog.close(); def checkFBF(task, results, browser): round0, round1 = results[0], results[1] From 2fc8bdcba51898d88c86e91ebaecbc9f4f854c35 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 5 Oct 2011 12:29:54 -0700 Subject: [PATCH 2/5] Add unbuffered option --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9cd2793f..c989f5ec9 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ browser-test: fi; cd test; \ - python test.py --reftest \ + python -u test.py --reftest \ --browserManifestFile=$(PDF_BROWSERS) \ --manifestFile=$(PDF_TESTS) From bb1f976ef3962cb331ed12cb5d6485ef70ee48fd Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 5 Oct 2011 15:08:45 -0700 Subject: [PATCH 3/5] Reversing -u option --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c989f5ec9..a9cd2793f 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ browser-test: fi; cd test; \ - python -u test.py --reftest \ + python test.py --reftest \ --browserManifestFile=$(PDF_BROWSERS) \ --manifestFile=$(PDF_TESTS) From e357b7a9f9757a59c65b6eeb00e75445a38e7e21 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 5 Oct 2011 16:32:26 -0700 Subject: [PATCH 4/5] Fix width and height for pattering bounding box. --- pdf.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdf.js b/pdf.js index 36e572eb7..1d92d88a5 100644 --- a/pdf.js +++ b/pdf.js @@ -6356,8 +6356,10 @@ var TilingPattern = (function tilingPattern() { graphics.transform.apply(graphics, tmpScale); graphics.transform.apply(graphics, tmpTranslate); - if (bbox && isArray(bbox) && 4 == bbox.length) { - graphics.rectangle(bbox[0], bbox[1], width, height); + if (bbox && isArray(bbox) && 4 == bbox.length) { + var bboxWidth = bbox[2] - bbox[0]; + var bboxHeight = bbox[3] - bbox[1]; + graphics.rectangle(bbox[0], bbox[1], bboxWidth, bboxHeight); graphics.clip(); graphics.endPath(); } From 86efbe8d003a299e91b75893039fbb0173d4e6be Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 6 Oct 2011 09:24:06 -0700 Subject: [PATCH 5/5] Fixing lint --- pdf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf.js b/pdf.js index 1d92d88a5..d1d2db4d7 100644 --- a/pdf.js +++ b/pdf.js @@ -6356,7 +6356,7 @@ var TilingPattern = (function tilingPattern() { graphics.transform.apply(graphics, tmpScale); graphics.transform.apply(graphics, tmpTranslate); - if (bbox && isArray(bbox) && 4 == bbox.length) { + if (bbox && isArray(bbox) && 4 == bbox.length) { var bboxWidth = bbox[2] - bbox[0]; var bboxHeight = bbox[3] - bbox[1]; graphics.rectangle(bbox[0], bbox[1], bboxWidth, bboxHeight);