Fix WebWorker logging and add separate timing for fonts.

This commit is contained in:
Julian Viereck 2011-06-23 15:24:55 +02:00
parent f32dfa9414
commit f256716022

View File

@ -17,7 +17,7 @@ function log() {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
postMessage({ postMessage({
action: "log", action: "log",
args: args data: args
}); });
} }
@ -62,7 +62,9 @@ onmessage = function(event) {
var fonts = []; var fonts = [];
var gfx = new CanvasGraphics(canvas.getContext("2d"), CanvasProxy); var gfx = new CanvasGraphics(canvas.getContext("2d"), CanvasProxy);
page.compile(gfx, fonts); page.compile(gfx, fonts);
toc("compiled page");
tic()
// Inspect fonts and translate the missing one. // Inspect fonts and translate the missing one.
var count = fonts.length; var count = fonts.length;
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
@ -75,7 +77,7 @@ onmessage = function(event) {
// This "builds" the font and sents it over to the main thread. // This "builds" the font and sents it over to the main thread.
new Font(font.name, font.file, font.properties); new Font(font.name, font.file, font.properties);
} }
toc("compiled page"); toc("fonts");
tic() tic()
page.display(gfx); page.display(gfx);