Commit Graph

1885 Commits

Author SHA1 Message Date
Yury Delendik
2008f74185 Refactors MessageHandler.send to remove callbacks 2014-05-07 18:15:25 -05:00
Jonas Jenwald
652dde48da Fix typo when rejecting Promise in getPage 2014-05-07 23:25:24 +02:00
Jonas Jenwald
f3f3db0d15 Remove 'info' and 'metadata' from GetDoc 2014-05-07 22:07:11 +02:00
Jonas Jenwald
069f0cc8c0 Remove 'javaScript' from GetDoc 2014-05-07 21:54:15 +02:00
Jonas Jenwald
4bfcb27d0b Remove 'outline' from GetDoc 2014-05-07 21:16:35 +02:00
Yury Delendik
95e61ad0e3 Adds pageviewport documentation 2014-05-05 14:09:47 -05:00
Yury Delendik
7ac1d6cdc8 Merge pull request #4708 from p01/graphic_optimizations_1
Graphic optimizations 1
2014-05-05 10:37:03 -05:00
Yury Delendik
b3f24ca0c7 Merge pull request #4733 from timvandermeij/postscript-unit-tests
Completes unit tests for PostScript evaluator and fixes two bugs in the evaluator itself
2014-05-05 10:27:54 -05:00
Yury Delendik
70da61fa01 Merge pull request #4729 from Snuffleupagus/remove-LegacyPromise
Remove LegacyPromise
2014-05-05 07:40:21 -05:00
p01
14a2d74d16 Optimized JPG.js - 33% faster convertCmykToRgb 2014-05-05 14:36:46 +02:00
p01
287274d3dc Optimized JPG.js - reduced memory usage + 2.16x faster getLinearizedBlockData
Linearize and scale the mcu blocks into the destination buffer in a single pass
2014-05-05 14:36:46 +02:00
p01
7067409e00 Optimized JPX's transformComponents 2014-05-05 14:36:45 +02:00
p01
27d532efeb Optimized PDFImage_undoPreblend 2014-05-05 14:36:45 +02:00
p01
83cd530f45 Cleaner putBinaryImageData 2014-05-05 14:22:44 +02:00
p01
f70a072cde Optimized CalGrayCS's convertToRgb 2014-05-05 14:22:43 +02:00
Yury Delendik
5fb42f6962 Merge pull request #4728 from Snuffleupagus/remove-LegacyPromise-worker.js
Remove LegacyPromise in src/core/worker.js
2014-05-05 07:10:03 -05:00
Tim van der Meij
4caf5b694e Completes unit tests for PostScript evaluator and fixes two bugs in the evaluator itself 2014-05-03 12:18:18 +02:00
Yury Delendik
ae92b6f96f Merge pull request #4726 from Snuffleupagus/remove-LegacyPromise-core.js
Remove LegacyPromise in src/core/core.js
2014-05-02 17:29:28 -05:00
Jonas Jenwald
87d38b0692 Remove LegacyPromise in src/core/worker.js 2014-05-03 00:09:49 +02:00
Yury Delendik
c68ba07c1c Merge pull request #4727 from Snuffleupagus/remove-LegacyPromise-annotation.js
Remove LegacyPromise in src/shared/annotation.js
2014-05-02 17:04:28 -05:00
Yury Delendik
a39f44fdf2 Merge pull request #4725 from Snuffleupagus/remove-LegacyPromise-pdf_manager.js
Remove LegacyPromise in src/core/pdf_manager.js
2014-05-02 17:02:05 -05:00
Jonas Jenwald
034f1102da Remove LegacyPromise in src/core/core.js 2014-05-02 22:10:21 +02:00
Jonas Jenwald
caad87eba5 Remove LegacyPromise in src/core/pdf_manager.js 2014-05-02 21:43:28 +02:00
Jonas Jenwald
cb59e7f872 Remove LegacyPromise in src/shared/annotation.js 2014-05-02 21:05:03 +02:00
Tim van der Meij
6b9aeb34f1 Fixes rendering of PDFs with nested trailer dictionary 2014-05-02 21:01:34 +02:00
Yury Delendik
f0043f8727 Merge pull request #4730 from yurydelendik/disableworker
Fixes disableWorker regression
2014-05-02 12:29:57 -05:00
Yury Delendik
e45f4767dd Fixes disableWorker regression 2014-05-02 12:23:46 -05:00
Jonas Jenwald
ad732f6403 Remove LegacyPromise 2014-05-02 01:48:17 +02:00
Yury Delendik
2b82eb0161 Fixes cancel rendering regression 2014-05-01 15:51:38 -05:00
Tim van der Meij
3ddc534920 Tiny updates 2014-05-01 21:05:32 +02:00
Jonas Jenwald
b6ff4aea2b Add onError function to ChunkedStreamManager 2014-05-01 18:20:55 +02:00
Jonas Jenwald
89c11ca9a2 Remove LegacyPromise in src/core/chunked_stream.js 2014-05-01 18:17:42 +02:00
Yury Delendik
aab48a2169 Merge pull request #4709 from pramodhkp/refactoring
Remove legacy promises from api.js
2014-05-01 11:10:03 -05:00
Pramodh KP
8616b2ccf3 Remove LegacyPromise from src/core/obj.js 2014-05-01 19:22:47 +05:30
Pramodh KP
0d5b41633f Remove legacy promises from api.js 2014-05-01 18:13:13 +05:30
Yury Delendik
63d5aae3f6 Groups path commands into single command 2014-04-30 09:09:04 -05:00
Jonas Jenwald
0fa154be4e Amend GlyphMapForStandardFonts to fix issue 4276 2014-04-30 15:56:40 +02:00
Yury Delendik
8e517b6d81 Merge pull request #4700 from pramodhkp/refactoring
Reject polyfill and createPromiseCapability
2014-04-29 09:09:04 -05:00
Pramodh KP
04b1eefb1d Added reject polyfill and PromiseCapability 2014-04-29 19:36:37 +05:30
Jonas Jenwald
747dec16b2 Prevent trying to map characters to the specials unicode block in adjustMapping (issue 4650) 2014-04-28 23:33:54 +02:00
Yury Delendik
58f697f977 Merge pull request #4528 from bthorben/lessColorConversion
Less color conversion
2014-04-28 08:28:33 -05:00
Yury Delendik
98e023e464 Guesses Type1C font type based on file content 2014-04-24 11:48:18 -05:00
Thorben Bochenek
e8f0700bfa Move the colour conversion to jpg.js
Benchmarking shows that this improves performance for the invitation document
from https://github.com/mozilla/pdf.js/issues/3809 by 35%
2014-04-24 15:07:12 +02:00
Thorben Bochenek
e7fe45a5c4 Refactor jpg.js and include forceRGBoutput, correct style of image.js
This refactors getData to be more readable and extracts all the color
conversion algorithms to their own functions. The resulting code was then
cleaned up.
This also introduces a flag `forceRGBoutput` to getData, that allows to always
get the data as a `width * height * 3` bytes long RGB buffer
2014-04-24 12:55:37 +02:00
p01
8f9bd33a57 PDFImage_resize: copy in place with alpha and ~5x speed up 2014-04-23 17:27:02 +02:00
Yury Delendik
bda1865fb8 Merge pull request #4520 from timvandermeij/annotation-icon-size
Force default icon size for Text annotations without appearance stream
2014-04-22 16:13:50 -05:00
p01
a66326cc54 Optimized JPX decoder ~6% faster 2014-04-22 15:34:26 +02:00
Yury Delendik
0845f90714 Merge pull request #4655 from Snuffleupagus/issue-4443
Add integer conversion to RGB colour values in convertToRgb in DeviceCmykCS (issue 4443)
2014-04-21 09:18:36 -05:00
Jonas Jenwald
ead5653cdc Add integer conversion to RGB colour values in convertToRgb in DeviceCmykCS (issue 4443) 2014-04-20 02:23:45 +02:00
fkaelberer
11f565547c Fix corrupted images #4649 2014-04-19 19:34:42 +02:00
Tim van der Meij
8d365b23ca Force default icon size for Text annotations without appearance stream 2014-04-18 21:11:56 +02:00
Samuel Chantaraud
25ee0e8572 Preliminary attachments support
Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
2014-04-18 12:11:00 -04:00
Yury Delendik
9a5c121e4d Fixes invalid CFF name for Mac OSX 2014-04-17 10:50:06 -05:00
Yury Delendik
a22258a6b3 Merge pull request #4638 from yurydelendik/issue4630
Recognizes ASCII type1 encoding
2014-04-17 08:39:31 -05:00
Yury Delendik
558c159e3d Merge pull request #4637 from fkaelberer/issue3483
Fix #3483 and simplify readCodingpasses()
2014-04-17 08:29:59 -05:00
Yury Delendik
bf3a2488df Recognizes ascii type1 encoding 2014-04-17 07:52:33 -05:00
fkaelberer
f52dfe4c81 Fix #3483 and simplify readCodingpasses() 2014-04-16 21:40:37 +02:00
fkaelberer
b06c10cbbd rename getUint32 to getInt32 and collect readInt*() in util.js 2014-04-16 21:31:16 +02:00
Yury Delendik
a468f7215d Fixes spacing in the text layer builder 2014-04-16 11:14:57 -05:00
Yury Delendik
dea4bdac49 Merge pull request #4538 from fkaelberer/lessCopyingInJPX
Less copying in the JPX decoder
2014-04-16 08:52:50 -05:00
Samuel Chantaraud
7a4543e348 Prevent the annotationLayer to be recreated when the page is redrawn
This allows interactive annotations to keep their states after a resize
2014-04-16 08:13:54 -04:00
fkaelberer
04602c8a5e Less copying in the JPX coder, merged and rebased 2014-04-16 10:40:04 +02:00
Rob Wu
2e97c0d085 Remove some unused variables from src/
Only obviously useless, local variables have been removed.
2014-04-15 17:10:23 +02:00
Yury Delendik
f954cde8f4 Merge pull request #4581 from Snuffleupagus/issue-4575
Check that images have valid dimensions (issue 4575)
2014-04-14 15:23:44 -05:00
Yury Delendik
eb8924a79f Merge pull request #4613 from yurydelendik/buildImagePromise
Refactors buildImage to use Promise; don't draw bad images
2014-04-14 15:23:06 -05:00
Yury Delendik
a00f854848 Refactors buildImage to use Promise; don't draw bad images 2014-04-14 15:22:35 -05:00
Yury Delendik
21f5dc22f3 Merge pull request #4616 from yurydelendik/jsdoc
Creates make.js code to build jsdoc.
2014-04-14 14:44:30 -05:00
Yury Delendik
2ca2c387fc Creates make.js code to build jsdoc. 2014-04-13 15:54:24 -05:00
Joshua T Kalis
5828b2c687 Refactor - remove redundant function and all references
The function `assertWllFormed` was doing nothing different than `assert` which is
available in the same namespace. Removing it will lighten the filesize - albeit
very slightly - and reduce complexity.
2014-04-13 16:18:07 -04:00
Yury Delendik
bb739c011e Merge pull request #4606 from timvandermeij/xrefentry
Makes PDF files load when xrefEntry is undefined
2014-04-12 19:37:14 -05:00
Yury Delendik
65fa25ca36 Fixes number of glyphs in the generated font 2014-04-12 13:25:13 -05:00
Tim van der Meij
dd3df20a88 Makes PDF files load when xrefEntry is undefined 2014-04-12 12:05:12 +02:00
Yury Delendik
36f1a1019d Merge pull request #4596 from brendandahl/seac-regression
Fix seac regression.
2014-04-11 13:43:12 -05:00
Brendan Dahl
6ac7f97dae Merge pull request #4599 from yurydelendik/issue4428
Adds then method to the RenderTask
2014-04-11 11:27:48 -07:00
Yury Delendik
8c0762a32a Adds then method to the RenderTask 2014-04-11 12:10:42 -05:00
Brendan Dahl
b242826d29 Fix seac regression. 2014-04-11 09:55:39 -07:00
Yury Delendik
175fbce0df Fixes documentation for PDFPage.render 2014-04-11 10:57:48 -05:00
Yury Delendik
88c1747cc3 Heuristics to recognize the unknown glyphs for toUnicode 2014-04-10 19:21:09 -05:00
Yury Delendik
2c61f60a4e Merge pull request #4577 from timvandermeij/reporter
Removes custom test/reporter.js from the lint process
2014-04-10 19:17:48 -05:00
Tim van der Meij
f463f96f35 Resolving new lint issues 2014-04-11 00:41:18 +02:00
Tim van der Meij
4e055169ed Fixes lint warning W004 in src/display/{api, canvas, pattern_helper}.js 2014-04-11 00:41:17 +02:00
Tim van der Meij
df91acf239 Fixes lint warning W004 in src/core 2014-04-11 00:41:08 +02:00
Tim van der Meij
10f80bda23 Fixes lint warning W004 in src/shared 2014-04-11 00:02:32 +02:00
Tim van der Meij
a71a87a821 Fixes lint warning W018: confusing use of exclamation mark 2014-04-11 00:02:31 +02:00
Yury Delendik
d61ee23afc Merge pull request #4556 from p01/OpaqueCanvas
Use Opaque Canvas
2014-04-10 16:54:26 -05:00
Yury Delendik
791c9a7b13 Relaxes murmurhash array requirement. 2014-04-10 07:55:08 -05:00
p01
b10aa18b3e Use Opaque Canvas where possible 2014-04-10 11:50:20 +02:00
Yury Delendik
9c84bfa416 Fixes text-selection example 2014-04-09 20:52:21 -05:00
Brendan Dahl
5bd8a83c9b Build the text layer geometry on the worker. 2014-04-09 16:44:07 -07:00
Yury Delendik
af536353d5 Merge pull request #4568 from p01/JPX_optimization
Jpx optimization
2014-04-09 17:25:11 -05:00
Yury Delendik
9ccdbbcb55 Merge pull request #4574 from Snuffleupagus/bug-850854
Handle 'space' character correctly in WinAnsiEncoding (bug 850854)
2014-04-09 14:36:49 -05:00
Brendan Dahl
a6e5f31ca1 Merge pull request #4423 from chriskr/font-aliases
Treat fonts with the same font descriptor and encoding as aliases
2014-04-09 10:26:09 -07:00
Yury Delendik
7a321dbf7e Merge pull request #4569 from Snuffleupagus/bug-878026
Handle 'space' character correctly in MacRomanEncoding (bug 878026)
2014-04-09 10:44:10 -05:00
p01
b77e647f4f JPX decoder 20-25% speed optimization 2014-04-09 16:58:40 +02:00
Jonas Jenwald
3a9b5b3951 Check that images have valid dimensions (issue 4575) 2014-04-09 13:04:27 +02:00
Jonas Jenwald
811f1b1d05 Workaround for cases where FontName in the FontDescriptor differs from BaseFont in the Font (bug 847420) 2014-04-09 11:29:33 +02:00
Christian Krebs
79f34b183c Treat fonts with the same font descriptor, encoding and unicode map as aliases
Different fonts can point to the same font descriptor
(see https://github.com/mozilla/pdf.js/issues/4339 for details). With this
commit such fonts are treated as aliases if they have also the same encoding
and the same toUnicode map. The according info is stored on the font descriptor.
This change must also ensure that aliases use always the same font name
because translated fonts can get cleared depending on the CLEANUP_TIMEOUT setting.
2014-04-08 20:45:21 +02:00
Brendan Dahl
608c6cea5a Merge pull request #4374 from yurydelendik/dictgetall
Doesn't traverse cyclic references in Dict.getAll; reduces empty-Dict GC
2014-04-08 10:43:42 -07:00
Jonas Jenwald
9e6c66be12 Handle 'space' character correctly in WinAnsiEncoding (bug 850854) 2014-04-08 13:07:29 +02:00
Brendan Dahl
ed1f8c33bd Merge pull request #4286 from yurydelendik/webgl
WebGL and misc memory optimizations
2014-04-07 14:33:34 -07:00
Jonas Jenwald
8fc4ebd5cb Handle 'space' character correctly in MacRomanEncoding (bug 878026) 2014-04-07 20:59:26 +02:00
fkaelberer
2982de8f33 Use Stream instead of byte array access 2014-04-06 13:40:27 +02:00
fkaelberer
1ccc8a64b7 Read color info from JPX stream
Fix colors problem #4540 + minor cleanup

fix lint warnings
2014-04-05 18:02:58 +02:00
Yury Delendik
f57c6935d7 Implements WebGL support 2014-04-03 08:36:22 -05:00
Yury Delendik
944219ad8a Balance smask process chunking 2014-04-03 08:34:21 -05:00
Yury Delendik
1e8d70af98 Prescales shading pattern packed data indices 2014-04-03 08:34:20 -05:00
Yury Delendik
5262e6f84f Set max size for the group 2014-04-03 08:34:20 -05:00
Yury Delendik
34f0f0962f Merge pull request #4539 from Snuffleupagus/issue-4537
Workaround for missing 'Rect' entry in annotation dictionaries (issue 4537)
2014-04-02 08:05:52 -05:00
Yury Delendik
20f6dedea7 Merge pull request #4512 from fkaelberer/cleanUpStringConversion
Clean up duplicate string conversion functions
2014-04-02 08:04:06 -05:00
Yury Delendik
dc0e60d103 Merge pull request #4535 from Snuffleupagus/issue-4484
Avoid drawing text when the font size is zero (issue 4484)
2014-04-02 07:23:43 -05:00
Yury Delendik
b97127aca2 Merge pull request #4542 from fkaelberer/typoInSpliceString
Fix typo/unused argument in fontloader.js->spliceString()
2014-03-31 09:37:26 -05:00
fkaelberer
4ee35b0d46 Fix typo/unused argument in fontloader.js->spliceString() 2014-03-31 14:48:23 +02:00
Jonas Jenwald
772df5e0cb Workaround for missing 'Rect' entry in annotation dictionaries (issue 4537) 2014-03-31 12:07:54 +02:00
Jonas Jenwald
08eb9a960a Avoid drawing text when the font size is zero (issue 4484) 2014-03-30 13:36:21 +02:00
fkaelberer
c978c026fa clean up string conversion functions 2014-03-27 13:01:43 +01:00
Jonas Jenwald
7e7b728b5d Assign non-zero width/height to all rectangles (issue 4260) 2014-03-26 22:29:04 +01:00
Yury Delendik
1d0286f6a1 Update util.js
Fixes comments for preprocessor
2014-03-26 13:19:10 -05:00
Yury Delendik
e80c6a8a75 Merge pull request #4466 from p01/Faster_1BPP_image_drawing
Faster 1 bpp image drawing
2014-03-26 10:32:05 -05:00
Yury Delendik
31f081ae17 Doesn't traverse cyclic references in Dict.getAll; reduces empty-Dict garbage 2014-03-26 09:07:38 -05:00
p01
4e6ebf2de0 Optimized putBinaryImageData for GRAYSCALE_1BPP
The following changes make putBinaryImageData 2.2x faster.

* Use a Uint32Array to draw whole pixels instead component by component

* Unroll the inner most loop

* Added lazy PDFJS.hasCanvasTypedArrays, PDFJS.isLittleEndian and compatibility
Uint32ArrayView for browsers using the old CanvasPixelArray
2014-03-26 14:05:59 +01:00
Manas (prometheansacrifice)
3025445cbe Fix for #3181: jbig2 encoding for number of instances greater than 1 2014-03-24 11:05:07 +05:30
Jonas Jenwald
e3b830e63c Merge pull request #4505 from timvandermeij/evaluator-syntax
Making src/core/evaluator.js adhere to the style guide
2014-03-23 12:22:09 +01:00
Jonas Jenwald
6883362a84 Fix coding style in src/core/stream.js 2014-03-22 21:21:01 +01:00
Jonas Jenwald
67b5c8868c Fix coding style in src/core/worker.js 2014-03-22 20:59:16 +01:00
Jonas Jenwald
75de115938 Fix coding style in src/core/font_renderer.js 2014-03-22 20:49:47 +01:00
Jonas Jenwald
131a16b65e Fix coding style in src/core/core.js 2014-03-22 20:49:46 +01:00
Jonas Jenwald
53bbdcb0a1 Fix coding style in src/core/chunked_stream.js 2014-03-22 20:49:46 +01:00
Tim van der Meij
c6a06c0f16 Making src/core/evaluator.js adhere to the style guide 2014-03-22 19:15:51 +01:00
Jonas Jenwald
66e243f506 Fix coding style in src/core/fonts.js 2014-03-22 16:19:07 +01:00
Brendan Dahl
1416eca164 Merge pull request #4493 from yurydelendik/issue4491
Fixes ignoring of the escaped CR LF
2014-03-20 14:57:24 -07:00
Tim van der Meij
284288f1d0 Making src/core/{image,obj,parser}.js adhere to the style guide 2014-03-20 20:28:22 +01:00
Yury Delendik
20a91bcdbf Fixes ignoring of the escaped CR LF 2014-03-20 11:50:12 -05:00
Yury Delendik
878a123e47 Merge pull request #4478 from nnethercote/plain-fnArray
Use a vanilla array for fnArray
2014-03-20 10:30:29 -05:00
Brendan Dahl
10deadd416 Merge pull request #4453 from nnethercote/charToGlyph
Add a cache for glyphs
2014-03-19 16:30:02 -07:00
Yury Delendik
1801fb2c37 Merge pull request #4474 from chriskr/draw-image-subpixel-support
Introduce paintSolidColorImageMask command to handle 1x1 solid image
2014-03-19 14:31:15 -05:00
Yury Delendik
305274cd45 Merge pull request #4481 from bthorben/refactor/pdf_manager.js
refactor src/core/pdf_manager.js: rename pdfModel to pdfDocument
2014-03-19 10:33:42 -05:00
Christian Krebs
fc9edfcf76 Introduce paintSolidColorImageMask command to handle 1x1 solid image masks
See https://github.com/mozilla/pdf.js/issues/4436 for details
2014-03-19 13:27:59 +01:00
Thorben Bochenek
0fa44d7233 refactor src/core/pdf_manager.js: rename pdfModel to pdfDocument
Rename pdfModel to pdfDocument to let the name closer resemble what the
variable actually holds
2014-03-19 09:43:16 +01:00
Yury Delendik
329d0ec30b Merge pull request #4464 from bthorben/issue#4461
Fixes pages without Resources in their dictionary
2014-03-18 13:00:21 -05:00
Thorben Bochenek
8edebc797b Refactor and fix style of core.js 2014-03-18 14:10:44 +01:00
Thorben Bochenek
1ddb019449 Fix Issue #4461: Pages without \Resources in their dictionary fail to load
When no "\Resource" entry could be found return an empty dictionary
2014-03-18 14:10:44 +01:00
Nicholas Nethercote
292b96a0bf Make fnArray always be a plain array.
This makes the code much simpler, and the extra memory use is tiny -- a vanilla
1000 element array is only 4000 bytes larger than a Uint32Array of the same
size.
2014-03-17 17:48:53 -07:00
Nicholas Nethercote
42d175efd4 Fix some indenting within OperatorList. 2014-03-17 17:11:40 -07:00
Brendan Dahl
1802ffffb8 Merge pull request #4447 from nnethercote/object-reduction
Allocate fewer objects
2014-03-17 12:50:23 -07:00
Brendan Dahl
68be273c69 Merge pull request #4470 from yurydelendik/packcmap
CMaps binary packing
2014-03-17 12:27:35 -07:00
Brendan Dahl
ad4be03a08 Merge pull request #4440 from bthorben/refactor/pdf_manager.js
refactor src/core/pdf_manager.js: rename pdfModel to pdfDocument
2014-03-17 10:41:17 -07:00
Jonas Jenwald
5f021b067c Prevent infinite loop in CFFParser_parseHeader 2014-03-17 11:47:14 +01:00
Brendan Dahl
1a6e103c35 Merge pull request #4463 from sukop/patch-1
Fix copy-paste typo
2014-03-14 15:24:16 -07:00
Yury Delendik
69efd9cb96 CMaps binary packing 2014-03-14 16:46:35 -05:00
Tim van der Meij
67c686027c Merge pull request #4465 from Snuffleupagus/src-display-braces
Fix coding style in src/display
2014-03-14 21:11:15 +01:00
Yury Delendik
8266225b73 Merge pull request #4434 from p01/jbig2Optimizations
Jbig2 optimizations
2014-03-14 10:39:41 -05:00
Juraj Sukop
4c2a462a76 Fix copy-paste typo
The Compact Font Format Specification defines the Standard String of SID 237 as "twodotenleader", and not "266 ff".
2014-03-14 14:11:16 +01:00
Jonas Jenwald
a1ee567d60 Fix coding style in src/display/api.js 2014-03-14 13:24:04 +01:00
Jonas Jenwald
bc986a3029 Fix coding style in src/display/canvas.js 2014-03-14 13:11:11 +01:00
Nicholas Nethercote
6c698519cd Avoid allocations in executeCommand(). 2014-03-13 22:15:09 -07:00
Nicholas Nethercote
3759c11f42 Avoid more allocations in bidi(). 2014-03-13 22:15:09 -07:00
Nicholas Nethercote
2e93a0cc98 Avoid allocations in bidi(). 2014-03-13 22:15:09 -07:00
Nicholas Nethercote
6a75e45309 Allocate fewer objects when parsing 2 and 4 byte chunks.
This is achieved by adding getBytes2() and getBytes4() to streams, and by
changing int16() and int32() to take multiple scalar args instead of an array
arg.
2014-03-13 22:15:05 -07:00
Nicholas Nethercote
0866ad5bff Add a cache for glyphs.
This reduces memory consumption for text heavy documents. I tested five
documents and saw hit rates ranging from 97.4% to 99.8% (most of the misses are
due to |width| varying even when |fontChar| matches). On two of those documents
I saw improvements of 40 and 50 MiB.

The patch also introduces the Glyph constructor, and renames the |unicodeChars|
local variable as |unicode| for consistency with the corresponding Glyph
property.
2014-03-13 19:51:48 -07:00
p01
bd9419f1ef Micro optimization of ArithmeticDecoder_readBit 2014-03-13 17:38:12 +01:00
p01
2b6cb317db Optmized decodeRefinement, moving the prediction error outside the inner loop
There is no need to slow down the inner loop with a test for ltp as it can only
change if prediction is true in which case it only changes in the outer loop.
2014-03-13 17:38:12 +01:00
p01
840d9d40b6 Reuse the row Uint8Array in JBIG2's decodeBitmap 2014-03-13 17:38:11 +01:00
p01
b2b3836683 Process only once the offset and starting mask JBIG2's drawBitmap 2014-03-13 17:38:11 +01:00
p01
0bca56cbb2 Use changingTemplateX, Y and Bit in JBIG2's decodeBitmap 2014-03-13 17:38:01 +01:00
p01
e2a4328ff2 Optimized bounding box tests in JBIG2's decodeBitmap 2014-03-13 17:38:00 +01:00
p01
2a9fe573c0 Nest JBIG2 prediction if statements together
ltp can only become truthy if predition is true.
2014-03-13 17:37:59 +01:00
p01
02a5f9435a More bit friendly decodeIAID and decodeInteger 2014-03-13 17:37:55 +01:00
p01
e862c64bb8 JBIG2 20% faster SimpleSegmentVisitor_drawBitmap
Moved the switch(combinationOperator) outside the width and height loops
Check bitmap[i][j] before applying the switch(combinationOperator)
2014-03-13 17:37:53 +01:00
Yury Delendik
1aaeec8020 Heuristic to optimize chunking 2014-03-13 11:01:34 -05:00
Yury Delendik
257898b359 Caching inlined mask images 2014-03-13 11:01:34 -05:00
Yury Delendik
f48f57e30a Caches last parsed resource image, recornizes image repeats 2014-03-13 11:00:10 -05:00
Yury Delendik
2c23be369b Optimizing pdf when text printed char-by-char 2014-03-13 11:00:10 -05:00
Yury Delendik
dbb3d17d8f Refactors optimization list 2014-03-13 11:00:10 -05:00
Yury Delendik
1c0e1cc591 Merge pull request #4444 from nnethercote/min-length
Estimate the size of decoded streams in advance.
2014-03-13 10:58:31 -05:00
Yury Delendik
2778d75d2c Merge pull request #4437 from yurydelendik/issue4398
Fixes corrupted by Aspose fonts
2014-03-13 10:44:02 -05:00
Yury Delendik
03bedaa316 Merge branch 'master' of github.com:mozilla/pdf.js into issue-4370 2014-03-13 10:38:11 -05:00
Jonas Jenwald
b0824e1626 Prevent circular reference when checking for blend modes (issue 4370) 2014-03-13 10:36:49 -05:00
Yury Delendik
7963f22545 Merge pull request #4259 from brendandahl/built-in-cmaps-squash
Adds built in CMaps and unifies the glyph mapping.
2014-03-13 10:27:48 -05:00
Yury Delendik
31ea4e0f4d Merge pull request #4420 from prometheansacrifice/RemovingCheckSetPresence
Removing set-presence-in-ImageData check from canvas.js
2014-03-13 08:31:53 -05:00
Yury Delendik
5c20d17c87 Merge pull request #4431 from fkaelberer/ExtractArithmeticDecoder
Extract arithmetic decoder to own file
2014-03-13 08:19:11 -05:00
Nicholas Nethercote
b3024db677 Estimate the size of decoded streams in advance.
When decoding a stream, the decode buffer is often grown multiple times, its
byte size increasing like so: 512, 1024, 2048, etc. This patch estimates the
minimum size in advance (using the length of the encoded stream), often
allowing the smaller sizes to be skipped. It also renames numerous |length|
variables as |maybeLength| to make it clear that they can be |null|.

I measured this change on eight documents. This change reduces the cumulative
size of decode buffer allocations by 0--32%, with 10--20% being typical. This
reduces peak RSS by 10 or 20 MiB for several of them.
2014-03-13 02:06:58 -07:00
Ben Browitt
8b6aeee35c Follow JMPR op only if outside of FDEF and IF 2014-03-13 03:19:04 +02:00
Thorben Bochenek
baccf3d160 refactor src/core/pdf_manager.js: rename pdfModel to pdfDocument
Rename pdfModel to pdfDocument to let the name closer resemble what the
variable actually holds
2014-03-12 09:54:29 +01:00
Nicholas Nethercote
ea17749b93 Don't get bytes eagerly when creating FlateStream objects. 2014-03-11 16:03:15 -07:00
Nicholas Nethercote
d0253c8291 Don't get bytes eagerly when creating {Jpeg,Jpx,Jbig2}Stream objects.
This avoids lots of unnecessary work when such streams are referred to via
fetch(), and so their bytes aren't subsequently read. This is a large
performance win on some files.
2014-03-11 16:03:15 -07:00
Nicholas Nethercote
f12d588258 Add an ensureRange() call to ChunkedStream_makeSubStream().
By checking if the data is all present before making a substream, we avoid
cases where we parse part of a stream and then throw a MissingDataException
part-way through, which forces us to later re-read the stream -- possibly
multiple times. This is a sizeable performance win for some cases when file
loading is slow (e.g. over the web).
2014-03-11 16:03:06 -07:00
Yury Delendik
7dbd088728 Fixes corrupted by Aspose fonts. 2014-03-11 14:16:27 -05:00
fkaelberer
2c8b776687 update comments 2014-03-11 09:14:59 +01:00
Manas (prometheansacrifice)
30e00bc573 Removing set-presence-in-ImageData check from canvas.js 2014-03-11 08:48:37 +05:30
Brendan Dahl
57e896d29e Merge pull request #4406 from nnethercote/fix-and-transfer-masks
Improve image mask handling again
2014-03-10 16:26:22 -07:00
Brendan Dahl
72a9c7810b Merge pull request #4246 from pnml/hiresmask
Support for the image mask in higher resolution than the image itself
2014-03-10 10:34:49 -07:00
fkaelberer
7b5b5178ef Extract duplicate arithmetic decoder to own class 2014-03-10 16:56:00 +01:00
Jonas Jenwald
b05f05589b Merge pull request #4425 from timvandermeij/jpx-syntax
Making src/core/jpx.js adhere to the style guide
2014-03-10 15:28:05 +01:00
Jonas Jenwald
7480ba4cb1 Merge pull request #4422 from timvandermeij/jbig2-syntax
Making src/core/jbig2.js adhere to the style guide
2014-03-10 11:33:39 +01:00
Tim van der Meij
d5fcfe14d2 Making src/core/jpx.js adhere to the style guide 2014-03-09 22:31:55 +01:00
Tim van der Meij
2712a5a45a Making src/core/jbig2.js adhere to the style guide 2014-03-09 13:03:45 +01:00
Tim van der Meij
f1249bd49e Making src/display/font_loader.js adhere to the style guide 2014-03-09 12:45:51 +01:00
Tim van der Meij
7d86fa859f Making src/display/metadat.js adhere to the style guide 2014-03-09 12:41:01 +01:00
Jonas Jenwald
46487e3931 Merge pull request #4418 from timvandermeij/crypto-syntax
Making src/core/crypto.js adhere to the style guide
2014-03-09 12:34:44 +01:00
Jonas Jenwald
fe99743844 Merge pull request #4413 from timvandermeij/ps-parser-syntax
Making src/core/ps_parser.js adhere to the style guide
2014-03-09 11:39:28 +01:00
Tim van der Meij
3330f0417f Making src/core/crypto.js adhere to the style guide 2014-03-08 23:25:47 +01:00
Tim van der Meij
99b0231343 Fixes typo in function.js 2014-03-08 22:40:19 +01:00
Tim van der Meij
df2248d5b9 Merge pull request #4414 from Snuffleupagus/src-shared-braces
Add braces to single line statements in src/shared
2014-03-08 22:37:16 +01:00
Tim van der Meij
a615ccdd20 Making src/core/bidi.js adhere to the style guide 2014-03-08 21:49:53 +01:00
Jonas Jenwald
4840c2ccdc Add braces to single line statements in src/shared/annotation.js 2014-03-08 20:50:38 +01:00
Jonas Jenwald
15a63e48bd Add braces to single line statements in src/shared/colorspace.js 2014-03-08 20:50:37 +01:00
Jonas Jenwald
00f6d07a21 Add braces to single line statements in src/shared/fonts_util.js 2014-03-08 20:50:37 +01:00
Jonas Jenwald
e8a68f12df Add braces to single line statements in src/shared/function.js 2014-03-08 20:50:36 +01:00
Jonas Jenwald
635466fcd2 Add braces to single line statements in src/shared/util.js 2014-03-08 20:50:36 +01:00
Tim van der Meij
2adcaf4f64 Making src/core/ps_parser.js adhere to the style guide 2014-03-08 20:45:25 +01:00
Nicholas Nethercote
00c1cff405 Transfer image masks when when possible, instead of copying. 2014-03-08 04:25:00 -08:00
Samuel Chantaraud
076b3433b4 Improved annotations' display/behavior.
Added an "InteractiveAnnotation" class to homogenize the annotations' structure (highlighting) and user interactions (for now, used for text and link annotations).

Text annotations:
The appearance (AP) has priority over the icon (Name).
The popup extends horizontally (up to a limit) as well as vertically.
Reduced the title's font size.
The annotation's color (C) is used to color the popup's background.
On top of the mouseover show/hide behavior, a click on the icon will lock the annotation open (for mobile purposes). It can be closed with another click on either the icon or the popup.

An annotation printing is conditioned by its "print" bit
Unsupported annotations are not displayed at all.
2014-03-07 10:48:42 -04:00
Nicholas Nethercote
cb5bb0cec7 Fix mask handling when some bytes are missing. 2014-03-06 21:11:21 -08:00
Tim van der Meij
3df8f89bd4 Fixes off-by-one error when finding missing endstream 2014-03-06 23:57:27 +01:00
Basil A. Zabairatsky
555d33ffc7 Support for the image mask in higher resolution than the image itself 2014-03-07 02:16:39 +06:00
Yury Delendik
1857ced63f Merge pull request #4397 from fkaelberer/FixJPXcolors
Fix JPX colors
2014-03-06 08:57:17 -06:00
fkaelberer
6755ea70b0 Fix infinite loop in DecodeStream_ensureBuffer() 2014-03-06 10:31:18 +01:00
fkaelberer
9457095c9c Fix JPX colors 2014-03-06 09:05:24 +01:00
Yury Delendik
ff5ccdeb07 Merge pull request #4383 from nnethercote/more-rgb24
Use RGB_24BPP form for all images lacking alpha data.
2014-03-05 07:03:16 -06:00
Yury Delendik
f04ebed579 Merge pull request #4366 from yurydelendik/max-fdefs
Rejects invalid fpgm table when too many functions
2014-03-05 06:16:44 -06:00
fkaelberer
eef5ed5c11 Optimizations for 1bpc images 2014-03-05 09:42:16 +01:00
Yury Delendik
f46942758f Merge pull request #4382 from nnethercote/off-by-one
Avoid extra allocations in ensureBuffer() caused by an off-by-one error.
2014-03-04 22:27:33 -06:00
Yury Delendik
32fe818af6 Merge pull request #4391 from nnethercote/rm-FakeStream
Remove FakeStream.
2014-03-04 21:36:44 -06:00
Yury Delendik
881c7f48f3 Merge pull request #4388 from timvandermeij/fix-corrupt-pdf-offset
Start counting from actual beginning of PDF file
2014-03-04 21:28:12 -06:00
Yury Delendik
fd6a152935 Merge pull request #4375 from yurydelendik/reset-annot
Reset annotation stream; reset page annotation promise
2014-03-04 21:23:13 -06:00
Yury Delendik
d809901083 Merge pull request #4381 from nnethercote/transfer
Transfer GRAYSCALE_1BPP and RGB_24BPP arrays when possible.
2014-03-04 21:04:02 -06:00
Nicholas Nethercote
fe8b6b0950 Remove FakeStream. 2014-03-04 18:07:15 -08:00
Tim van der Meij
026c45e5d1 Start counting from actual beginning of PDF file 2014-03-04 22:16:54 +01:00
Nicholas Nethercote
a2fe30ff38 Use RGB_24BPP form for all images lacking alpha data. 2014-03-03 20:58:35 -08:00
Nicholas Nethercote
f30babde58 Transfer GRAYSCALE_1BPP and RGB_24BPP arrays when possible. 2014-03-03 18:17:17 -08:00
Nicholas Nethercote
64431a9909 Avoid extra allocations in ensureBuffer() caused by an off-by-one error. 2014-03-03 18:03:48 -08:00
Yury Delendik
10af056f8f Reset annotation stream; reset page annotation promise 2014-03-03 16:46:05 -06:00
Yury Delendik
6fbbcf5c93 Merge pull request #4362 from Snuffleupagus/bug-925985
Add 'registered' and 'trademark' to mapPrivateUseChars (bug 925985)
2014-03-03 09:02:32 -06:00
Nicholas Nethercote
6e4283fc45 Remove unneeded |oldtypes| variable from bidi.js. 2014-03-03 05:09:04 -08:00
Yury Delendik
ba95e0b07b Merge pull request #4353 from nnethercote/more-Array-joins
Use Array.join() to build up strings in more places.
2014-03-02 23:26:22 -06:00
Nicholas Nethercote
ab7568c0ff Use Array.join() to build up strings in more places. 2014-03-02 17:54:16 -08:00
Yury Delendik
9a918572dd Merge pull request #4336 from nnethercote/rgb24
Special-case 24-bit RGB image-handling
2014-03-02 19:53:42 -06:00
Yury Delendik
ad4eb9a21d Merge pull request #4354 from nnethercote/Name-cache
Use a cache to minimize the number of Name objects.
2014-03-02 18:44:29 -06:00
Yury Delendik
f8c11634d8 Merge pull request #4355 from nnethercote/sliced-masks
Put mask data to the canvas in small slices.
2014-03-02 18:40:38 -06:00
Yury Delendik
adca8d4291 Rejects invalid fpgm table when too many functions 2014-03-02 15:40:48 -06:00
fkaelberer
583ca3b162 Fix parsing of JP2 images 2014-03-02 22:15:40 +01:00
Mitar
2c82e720b8 Updated to current latest stable version of jshint. 2014-03-01 13:31:25 -08:00
Jonas Jenwald
08687ee9f1 Add 'registered' and 'trademark' to mapPrivateUseChars (bug 925985) 2014-03-01 21:01:33 +01:00
Yury Delendik
5c40d686d4 Merge pull request #4357 from d3x7r0/master
Allow a url to omit the protocol
2014-02-28 14:32:19 -06:00
Yury Delendik
a9caf97f85 Merge pull request #4348 from bthorben/refactor/obj.js/2
Refactor XRef in obj.js
2014-02-28 13:19:33 -06:00
Yury Delendik
b01301c7ba Merge pull request #4324 from fkaelberer/FasterJBIG2decoding
Faster JBIG2 decoding
2014-02-28 12:54:36 -06:00
Brendan Dahl
a77efa0587 Remove unused calculation from bad merge. 2014-02-28 09:58:07 -08:00
Luís Nabais
220a8e4f0e Fix the combineUrl function
* Allow a url to omit the protocol and use the same protocol as the
* current page
2014-02-28 17:25:46 +00:00
Thorben Bochenek
f2f713bf15 Refactor XRef in obj.js
- remove unused "if (e instanceof Stream)" in XRef_fetch
- split XRef_fetch into XRef_fetchUncompressed and XRef_fetchCompressed
This explains the actual code flow better
- add line breaks after functions
- change the document to conform to current StyleGuide
2014-02-28 14:00:54 +01:00
fkaelberer
abcc72a173 Faster JBIG2 decoding 2014-02-28 10:53:09 +01:00