Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web worker integration. #692

Merged
merged 129 commits into from
Oct 21, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
6dd82ad
Track loaded such that setFont doesnt need to touch xref anymore
jviereck Sep 5, 2011
e9f4a3d
Need to use font.translated.name as unique identifier
jviereck Sep 5, 2011
2c51c6f
Set loadedName in Partial Eval
jviereck Sep 5, 2011
0a57189
Very basic worker implementation
jviereck Sep 5, 2011
e3dd329
Move ensureFont code part of Page into its own function
jviereck Sep 5, 2011
0134143
Split compilation up in preCompile and Compile.
jviereck Sep 6, 2011
71ff8ee
backup
jviereck Sep 6, 2011
5a1488d
Expose FontMeasure only if running on the main thread as the worker d…
jviereck Sep 6, 2011
cc17707
First page is rendering using new worker infrastructure
jviereck Sep 6, 2011
eca8f6b
Working towards embedded image support
jviereck Sep 6, 2011
67f7454
Add support for xobj embedded images that are not rendered by the pla…
jviereck Sep 6, 2011
2fcc93c
Make xObjForm use raw format
jviereck Sep 6, 2011
aa8699a
Don't display cmds used on the page by default + turn on worker suppo…
jviereck Sep 6, 2011
5c1262e
Add limited support for setFill/StrokeColorSpace
jviereck Sep 6, 2011
89167c0
Saving last work
jviereck Sep 6, 2011
a3baea5
Make shadingFill IR form
jviereck Sep 7, 2011
ac4a57e
Refactor to execute IR on main thead by posting messages to itself
jviereck Sep 7, 2011
c77c6d5
Add setFillColorN_IR by implementing new TilingPatternIR
jviereck Sep 7, 2011
cdc937a
Fix missing curMatrix variable bug to get TM paper work in Nightly
jviereck Sep 7, 2011
c466450
Use the worker
jviereck Sep 7, 2011
9e3de8b
Add shading support for setFillColorN_IR - is that used at all?
jviereck Sep 7, 2011
5543d6f
Move getting the Pattern from IR form out and make setStrokeColorN_IR…
jviereck Sep 7, 2011
5bfa9e4
Add some comments + fix getColorN_IR_Pattern
jviereck Sep 7, 2011
d887d2b
Implement paintReadyJpegXObject + add infrastructure to handle JpegSt…
jviereck Sep 7, 2011
62afa95
Add support for image xObjs with imageMask
jviereck Sep 7, 2011
a4cfc44
Add rendering timer
jviereck Sep 7, 2011
e7fa637
Remove no longer needed code and rename IR forms to the standard ones
jviereck Sep 7, 2011
f369bd3
[Cleanup] Rename Raw to IR
jviereck Sep 7, 2011
a83f491
[Cleanup] Renomve no longer needed RadialAxialShading.prototype.getPa…
jviereck Sep 7, 2011
1c30fda
Implement ColorSpace IR forms for Pattern and Indexed
jviereck Sep 7, 2011
a7d1c84
Make ColorSpace.parse use ColorSpace.toIR and .fromIR to make use of …
jviereck Sep 7, 2011
790816b
Use all over the place and cleanup/renomve not longer needed code
jviereck Sep 8, 2011
2269bcc
[Cleanup] Remove no longer needed Patter.parse and TilingPattern. fun…
jviereck Sep 8, 2011
443bb84
Add very simple Promise object
jviereck Sep 8, 2011
e7b636d
Flattern the IRQueue to make it easier to reexecute and have no neste…
jviereck Sep 8, 2011
7e3bbcc
Add dependency management for loading images that causes the executio…
jviereck Sep 8, 2011
89afa69
Fix rendering of fonts on Firefox + turn worker on again.
jviereck Sep 8, 2011
fea3388
Make testdriver use new worker infrastructure
jviereck Sep 8, 2011
4e3f87b
Make ColorSpace Separation work as long as no IR form is needed for now
jviereck Sep 8, 2011
8572c29
Fix missing parameter for RadialAxialShading
jviereck Sep 8, 2011
9dcefe1
Add PDFFunction to IR support + complete ColorSpace SeparationCS IR s…
jviereck Sep 8, 2011
755399a
Fix TilingPattern + implement DummyShading IR form
jviereck Sep 8, 2011
2b7ff49
Fix constructInterpolatedFromIR + fix indexing i that should be j
jviereck Sep 8, 2011
7ee894c
fontFile doesn't have to be a FlateStream. complex_ttf_font.pdf
jviereck Sep 9, 2011
a2bf701
Implement endInlineImage IR
jviereck Sep 9, 2011
c370b8a
Ensure things work for default fonts like Arial
jviereck Sep 9, 2011
cda4c04
Removing some console.log statements.
jviereck Sep 9, 2011
3425478
Adding back bug in constructInterpolatedFromIR to get refTest passing…
jviereck Sep 9, 2011
90da4fc
Ensure to call the pageDone callback after it's really done
jviereck Sep 9, 2011
a228753
Add missing metrics.js for worker
jviereck Sep 15, 2011
32ae879
Stop the execution if it takes longer then a certain amount of time a…
jviereck Sep 9, 2011
ac11f30
Send JpegStreams to the main thread ASAP. No need for ImagesLoader an…
jviereck Sep 9, 2011
dd9aea2
Trying to implement progressive font rendering. Works on FF, but Chro…
jviereck Sep 9, 2011
e15bfc0
Fixing font loading issues
jviereck Sep 10, 2011
6e9306a
Remove console.logs from previous commit again
jviereck Sep 9, 2011
d639a9a
Remove no longer needed worker files, rename boot to boot_processor
jviereck Sep 9, 2011
9eb7858
Fix
jviereck Sep 10, 2011
e9fff59
Remove worker/boot.js
jviereck Sep 10, 2011
6dcf9f4
Make font processing happen in a worker
jviereck Sep 10, 2011
86681a8
Add Objects.setData and Promise.data to set the data before the objec…
Sep 13, 2011
966cbc2
Add FontShape.getRule which returns the name for the ctx object
jviereck Sep 13, 2011
9d2806e
Use canvas measureText to detect font loading
jviereck Sep 14, 2011
18ce3eb
Just use imageData directly on Gecko
jviereck Sep 14, 2011
22e938d
Addd font logs
jviereck Sep 15, 2011
fa9f9e0
Fix rebasing
jviereck Sep 15, 2011
9e84dd3
Add Objects.clear() and fallback for testStr in FontMeasure
jviereck Sep 15, 2011
845230d
Ensure fonts loaded in caes you load fonts out of line
jviereck Sep 15, 2011
8e36114
If the font isn't supported, don't handle it
jviereck Sep 16, 2011
5ecbc64
Backup
jviereck Sep 16, 2011
16e4d4e
Add support for WebKit using measure on canvas method
jviereck Sep 16, 2011
06cef91
Cleanup Moz support in FontLoader
jviereck Sep 16, 2011
8f21f87
Add firstPage option to tasks to speed up testing certain pages
jviereck Sep 16, 2011
0f6bf30
Add dependency for dependecies on sub getIRQueue
jviereck Sep 16, 2011
20d8a13
Don't stop executeIRQueue if there is no continueCallback. What a won…
jviereck Sep 16, 2011
921f8bd
Tried to add a destroy function to free memeory, but doesn't seem to …
jviereck Sep 16, 2011
00290b9
Rename some stuff and add missing font_handler.js
jviereck Sep 16, 2011
cc661f4
Fix regression in PDFFunction
jviereck Sep 16, 2011
86b8f12
Ensure dependent font data is available before calling startRendering…
jviereck Sep 30, 2011
e6bd3d8
Backup
jviereck Oct 1, 2011
0e89526
Add missing resolve for font obj and make sure image objs ids are str…
jviereck Oct 1, 2011
9c58cd4
Don't add a dependency to the array if the array already contains it
jviereck Oct 1, 2011
b69c6cb
Remove $ from property names.
jviereck Oct 1, 2011
ecb622c
Remove isGecko detection for now
jviereck Oct 1, 2011
4484482
Add comments for the kExecutionTime/Check in CanvasGraphics
jviereck Oct 2, 2011
88e78fa
Add new PDFObjects that replaces former (global) Objects. There is no…
jviereck Oct 2, 2011
e9b6ffb
Kill global objects
jviereck Oct 2, 2011
d7521f7
Merge font and processor working into one worker and fix some bugs in…
jviereck Oct 5, 2011
3054102
Merge worker_pull with master
jviereck Oct 8, 2011
06994d3
Transform setGState to IR form and hanlde edge case of setFont
jviereck Oct 8, 2011
8929e6b
Move WorkerPDFDoc to pdf.js. Rename PDFDoc -> PDFDocModel + WorkerPDF…
jviereck Oct 8, 2011
23e4135
Small fixes + docs
jviereck Oct 8, 2011
4258da3
Try to rescue fonts - not working
jviereck Oct 8, 2011
75884a6
Hack something up that renders font right again
jviereck Oct 8, 2011
90e2546
Process fonts on main thread again - font handling works again
jviereck Oct 8, 2011
be73cb4
Don't create Image object in JpegStream
jviereck Oct 8, 2011
4e3f0e7
Get Type3 fonts working again.
jviereck Oct 8, 2011
a618083
Fix hello world example
jviereck Oct 8, 2011
20a348f
Fix lint errors
jviereck Oct 9, 2011
d313115
Add a timeout before sending the pdf doc to the worker such that ther…
jviereck Oct 9, 2011
ac32f6f
Fix variable naming
jviereck Oct 9, 2011
98b4c5b
Fix ColorSpace lookup in ColorSpace.parseToIR
jviereck Oct 9, 2011
7acec47
Let handleSetFont use a fontRef directly. Fixes extgstate.pdf
jviereck Oct 9, 2011
1b69ca8
Remove commented out code and change some comments to fit current cod…
jviereck Oct 11, 2011
aa98632
Fixing DescendantFonts object fetching (#600)
notmasteryet Oct 8, 2011
15cbb5a
Fixing disappearing pages (when multiple are visible)
notmasteryet Oct 9, 2011
633baa8
Make test_slave.html as valid html5.
kkujala Oct 10, 2011
9b8ce24
Kill global vars FontsMap, FontLoadedCounter, objIdCounter.
jviereck Oct 11, 2011
268d16a
Remove no longer needed viewer_worker.html
jviereck Oct 11, 2011
15d1d35
Fix lint, remove for old worker code, fix some small stuff
jviereck Oct 11, 2011
3142c2a
Merge master -> worker_pull + fix too long line
jviereck Oct 11, 2011
b832aa5
Address latest review comments by Artur
jviereck Oct 13, 2011
fdf8ef3
Fix `length` in setGState().
jviereck Oct 13, 2011
c950810
Initial merge with master
Oct 19, 2011
65ea07a
Initial merge of master.
Oct 19, 2011
452f33b
Remove WorkerPage.
Oct 19, 2011
d4a810e
Fix merge problem with argsArray/fnArray.
Oct 20, 2011
211cf22
Fix setting the font from graphics state. Fix
Oct 20, 2011
2ad1e62
Move remaining worker.js code into pdf.js.
Oct 20, 2011
1d66c0e
Rename JpegStreamIr to just JpegImage since it isn't
Oct 20, 2011
82aef59
Refactor TilingPattern to be more similar to the
Oct 20, 2011
29ed0be
Merge upstream/master.
Oct 20, 2011
435d9f2
Removing all console logs.
Oct 20, 2011
b873c1f
Fix imageObj.imageMask bug from merge
jviereck Oct 21, 2011
8a6f9ae
Merge pull request #1 from jviereck/integration
brendandahl Oct 21, 2011
5293a24
Merge remote-tracking branch 'upstream/master' into integration
Oct 21, 2011
d272f83
Merge remote-tracking branch 'origin/integration' into integration
Oct 21, 2011
23363cf
Remove debugger
Oct 21, 2011
300730c
Addressing Vivian's comments.
Oct 21, 2011
a203437
Fix lint error.
Oct 21, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/helloworld/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<script type="text/javascript" src="../../metrics.js"></script>
<script type="text/javascript" src="../../fonts.js"></script>
<script type="text/javascript" src="../../glyphlist.js"></script>
<script type="text/javascript" src="../../worker/message_handler.js"></script>
<script type="text/javascript" src="../../worker/processor_handler.js"></script>

<script type="text/javascript" src="hello.js"></script>
</head>
Expand Down
12 changes: 12 additions & 0 deletions fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,19 @@ var FontLoader = {
for (var i = 0; i < fonts.length; i++) {
var font = fonts[i];

// If there is already a fontObj on the font, then it was loaded/attached
// to the page already and we don't have to do anything for this font
// here future.
if (font.fontObj) {
continue;
}

var obj = new Font(font.name, font.file, font.properties);

// Store the fontObj on the font such that `setFont` in CanvasGraphics
// can reuse it later again.
font.fontObj = obj;

objs.push(obj);

var str = '';
Expand Down
Loading