Commit Graph

7432 Commits

Author SHA1 Message Date
Kalervo Kujala
0c5525dc8a CalRGB: optimize CalRGB calculations
Also fix one silly mistake.
2014-08-16 11:38:15 +03:00
Yury Delendik
3ad972ad45 Merge pull request #5199 from yor-mozilla-com/bug1054590
Bug 1054590 - [pdf.js] Update to use gaia-header
2014-08-15 22:57:37 -05:00
Yan Or
d8bc16362c Bug 1054590 - [pdf.js] Update to use gaia-header 2014-08-15 17:57:07 -07:00
Yury Delendik
90d79d1577 Merge pull request #5198 from timvandermeij/svg-paintformxobject
Implements paintFormXObject in svg.js
2014-08-15 16:29:30 -05:00
Tim van der Meij
32853c07f4 Implements paintFormXObject in svg.js 2014-08-15 23:23:04 +02:00
Yury Delendik
34449f6d9c Merge pull request #5195 from Snuffleupagus/typed-array-api-unittest
Add unit test for PDF file loaded as typed array
2014-08-15 10:46:35 -05:00
Yury Delendik
c2f4b9d301 Merge pull request #5194 from nnethercote/no-absolute
Remove `position: absolute` from text divs.
2014-08-15 10:38:23 -05:00
Jonas Jenwald
9f1e140c4f Add unit test for PDF file loaded as typed array 2014-08-15 17:21:46 +02:00
Yury Delendik
e53a28c996 Merge pull request #5192 from nnethercote/empty-setGState
Ignore setGState no-ops.
2014-08-15 10:20:14 -05:00
Yury Delendik
fa8d385818 Merge pull request #5165 from kkujala/calrgb
implement CalRGB color space
2014-08-15 10:19:49 -05:00
Nicholas Nethercote
9695958ebc Remove position: absolute from text divs.
It's not necessary in each text div, because it's specified in the
`.textLayer > div` rule.
2014-08-15 08:17:20 -07:00
Yury Delendik
5eb6a353d9 Merge pull request #5181 from timvandermeij/svg-optimizations
Optimizes defaults for svg.js
2014-08-15 09:40:41 -05:00
Yury Delendik
9b3c96d5d3 Merge pull request #5186 from Snuffleupagus/fix-CMap-unavailable-error-handling
Fix the error handling for CMaps that fail to load
2014-08-15 08:31:33 -05:00
Yury Delendik
992e7613c1 Merge pull request #5187 from nnethercote/EI-checking
Reduce ASCII checks in makeInlineImage().
2014-08-15 08:29:03 -05:00
Jonas Jenwald
9b480d70eb Merge pull request #5168 from nnethercote/EvaluatorPreprocessor_read
Avoid unnecessary array allocations in EvaluatorPreprocessor_read().
2014-08-15 13:35:05 +02:00
Jonas Jenwald
9d87cbc516 Merge pull request #5191 from nnethercote/getSampleArray-array-length
Right-size the array in getSampleArray().
2014-08-15 11:36:35 +02:00
Nicholas Nethercote
9674abc542 Ignore setGState no-ops.
For the document in #2504, 11% of the ops are `setGState` with a
`gStateObj` that is an empty array, which is a no-op. This is possible
because we ignore various setGState keys (OP, OPM, BG, etc).

This change prevents these ops from being inserted into the operator
list.
2014-08-14 20:46:28 -07:00
Nicholas Nethercote
bcc31b666f Right-size the array in getSampleArray().
This allows the JS engine to do a better job of allocating the right
number of elements for the array, avoiding some resizings. For the PDF
in #2504, this avoids 100s of MiBs of allocations in Firefox.
2014-08-14 18:56:12 -07:00
Nicholas Nethercote
ffae848f4e Reduce ASCII checks in makeInlineImage().
makeInlineImage() has a "are the next five chars ASCII?" check which is
run after an "EI" sequence has been found. This check involves the
creation of a new object because peekBytes() calls subarray().

Unfortunately, the check is currently run on whitespace chars even when
an "EI" sequence has not yet been found, i.e. when it's not needed. For
the PDF in #2618, there are over 820,000 such checks.

This change reworks the relevant loop so that the check is only done
once an "EI" sequence has been seen. This reduces the number of checks
to 157,000, and speeds up rendering by somewhere between 2% and 7% (the
measurements are noisy).
2014-08-14 16:20:58 -07:00
Jonas Jenwald
cd5bd9fb7e Merge pull request #5184 from yurydelendik/cff-width
Use cff glyph width in the hmtx table
2014-08-14 23:40:12 +02:00
Tim van der Meij
1d02ace81f Optimizes defaults for svg.js 2014-08-14 23:14:55 +02:00
Yury Delendik
a2c2f81167 Use cff glyph width in the hmtx table 2014-08-14 16:11:09 -05:00
Tim van der Meij
90afb70e44 Merge pull request #5188 from yurydelendik/svg-refact
Refactors some SVG api and includes svg.js in the build
2014-08-14 23:01:00 +02:00
Kalervo Kujala
1e4a7f981e implement CalRGB color space
Both whitespace and blackspace support are implemented.
2014-08-14 23:49:19 +03:00
Yury Delendik
de23d3791e Fixes image and font embedding 2014-08-14 15:11:27 -05:00
Yury Delendik
0f862e7eb3 Adds svg.js to the generic and singlefile builds 2014-08-14 13:02:30 -05:00
Yury Delendik
bc574aa629 Refactors SVG api 2014-08-14 12:56:11 -05:00
Yury Delendik
36eac09171 Merge pull request #5182 from pramodhkp/svgcli1
SVG Command line tool for exporting output
2014-08-14 12:50:38 -05:00
pramodhkp
0e5998a325 Added svg export tool 2014-08-14 23:18:19 +05:30
Jonas Jenwald
9ef0d0b878 Fix the error handling for CMaps that fail to load 2014-08-14 16:29:10 +02:00
Yury Delendik
d07b26d427 Merge pull request #5185 from Snuffleupagus/fix-cmap-unittests
Fix CMap unit tests
2014-08-14 08:39:18 -05:00
Jonas Jenwald
b201cc4940 Remove the remaining references to cidmaps.js from the test suite 2014-08-14 12:42:57 +02:00
Jonas Jenwald
1fb404aff2 Fix CMap unit tests
When the binary CMaps were added, some of the relevant unit tests were not changed. This patch updates them, so that we actually test the current implementation.
What's somewhat troubling here is that we currently have CMap unit tests that passes, *despite* not working as intended (the CMap files doesn't load).
2014-08-14 12:36:49 +02:00
Yury Delendik
84457b77ed Merge pull request #5183 from yurydelendik/type2-width
Adds width at the beginning of the Type2 charstring
2014-08-13 21:48:45 -05:00
Yury Delendik
0ad323f621 Adds width at the beginning of the Type2 charstring 2014-08-13 21:15:40 -05:00
Yury Delendik
84584f98f7 Merge pull request #5180 from pramodhkp/svgcli1
Minor changes for api.js, font_loader.js and svg.js
2014-08-13 15:00:24 -05:00
pramodhkp
6d53fc4db7 Minor changes for api.js, font_loader.js and svg.js 2014-08-14 01:01:09 +05:30
Yury Delendik
7fb6c87774 Merge pull request #5179 from timvandermeij/misc-svg-fixes
Miscellaneous code improvements for svg.js
2014-08-13 13:45:03 -05:00
Tim van der Meij
44fbf0ce14 Miscellaneous code improvements for svg.js 2014-08-13 20:31:21 +02:00
Tim van der Meij
f36bfccedf Merge pull request #5177 from Snuffleupagus/remove-debug-console-log
Remove two instances of leftover console.log debug statements
2014-08-13 17:21:14 +02:00
Jonas Jenwald
06b5d97bc6 Remove two instances of leftover console.log debug statements
The `console.log` statement in evaluator_spec.js is obviously not needed. In obj.js it could have been replaced by `info`, but that seemed unnecessary given the already existing `error`.
2014-08-13 14:29:46 +02:00
Jonas Jenwald
c3691500fa Merge pull request #5172 from nnethercote/readCharCode-retval
Avoid an allocation in readCharCode().
2014-08-13 11:03:07 +02:00
Nicholas Nethercote
61e6b576d4 Avoid an allocation in readCharCode().
readCharCode() returns two values, and currently allocates a length-2
array on every call to do so. This change makes it instead us a
passed-in object which can be reused.

This tiny change reduces the total JS allocations done for the document
in Mozilla bug 992125 by 4.2%.
2014-08-12 16:12:58 -07:00
Yury Delendik
41a5bce6de Merge pull request #5174 from Snuffleupagus/even-more-api-unittests
Add even more unit tests for the API
2014-08-12 09:20:59 -05:00
Tim van der Meij
03fd24bde2 Merge pull request #5175 from Snuffleupagus/disable-first/last-page-buttons
Disable the "Go to First/Last Page" buttons when the first/last page is currently active
2014-08-12 13:39:24 +02:00
Jonas Jenwald
ca1dbda348 Disable the "Go to First/Last Page" buttons when the first/last page is currently active
Since the "Previous/Next Page" buttons are disabled when the first/last page is active, I think that for the sake of consistency the "Go to First/Last Page" should behave the same way.
2014-08-12 12:58:59 +02:00
Jonas Jenwald
fc5ad8a8d6 Add even more unit tests for the API
This patch replaces most of the remaining TODOs in test/unit/api_spec.js with actual tests.
2014-08-12 12:09:31 +02:00
Tim van der Meij
249b8f4137 Merge pull request #4156 from Fitoschido/patch-1
Reduce load progress bar’s height to 4 pixels
2014-08-12 11:34:46 +02:00
Adolfo Jayme Barrientos
ba426f479e Reduce load progress bar’s height to 4 pixels 2014-08-11 23:09:38 -05:00
Nicholas Nethercote
7cbd057deb Avoid unnecessary array allocations in EvaluatorPreprocessor_read().
EvaluatorPreprocessor_read() is called in two cases. For the normal
layer, the args array it produces is used beyond the bounds of the loop
in which EvaluatorPreprocessor_read() is called.

But for the text layer, the args array is used in a very short-term
fashion. This change reworks things so that a single array is repeatedly
used for the text layer. This reduces total JS allocations for the
Spoorkaart map by 11%, and has similar effects on many other PDFs.
2014-08-11 16:57:40 -07:00