Make the ProxyCanvas be more a canvas - provide a ctx object to interact through

This commit is contained in:
Julian Viereck 2011-06-22 20:04:25 +02:00
parent fe7c8b52f6
commit 50d902d9eb
2 changed files with 22 additions and 25 deletions

View file

@ -18,11 +18,6 @@ importScripts("glyphlist.js")
// Use the JpegStreamProxy proxy.
JpegStream = JpegStreamProxy;
// var array = new Uint8Array(2);
// array[0] = 1;
// array[1] = 300;
// postMessage(array);
var timer = null;
function tic() {
timer = Date.now();
@ -33,15 +28,8 @@ function toc(msg) {
timer = null;
}
// Create the WebWorkerProxyCanvas.
var canvas = new CanvasProxy(1224, 1584);
// canvas.moveTo(0, 10);
// canvas.lineTo(0, 20);
// canvas.lineTo(500, 500);
// canvas.flush();
// canvas.stroke();
// canvas.flush();
log("test");
var pageInterval;
var pdfDocument = null;
@ -61,7 +49,7 @@ onmessage = function(event) {
// page.compile will collect all fonts for us, once we have loaded them
// we can trigger the actual page rendering with page.display
var fonts = [];
var gfx = new CanvasGraphics(canvas, ImageCanvasProxy);
var gfx = new CanvasGraphics(canvas.getContext("2d"), ImageCanvasProxy);
page.compile(gfx, fonts);
// Inspect fonts and translate the missing one.