[webkit-dev] Canvas rendering changes between Safari and Nightlies

Dimitri Bouniol dimitri008 at mac.com
Sat Mar 29 12:47:02 PDT 2008


I am using a canvas to render images at a perspective on my site by  
rendering each line of pixels at a different scale.
The canvas object is all the icons that appear at the top of the page  
in the grey bar.
In Safari (3.1 and below), everything renders quickly and looks  
normal, but in recent Nightly builds, rendering time is significantly  
increased and rendering looks very bizarre.
I think it has something to do with drawing and scaling images using  
transforming methods, but I'm not sure, and was wondering If someone  
could take a look at it so I can locate the issue and either file a  
bug of fix my own code.

Site: http://appkainime.bouniol.homeip.net/
Javascript: http://appkainime.bouniol.homeip.net/js/master.js

Methods of interest:

- drawAppFlow()
Calls drawInContextWithPerspectiveAndArg several times at different  
positions with each image to be drawn at a perspective.

- drawInContextWithPerspectiveAndArg(drawFunction, ctx, x, y, z,  
width, height, arg)
Draws the drawFunction(ctx, arg) in the context ctx using the one- 
point perspective at (x, y, z), by calling drawFunction(ctx, arg) for  
every vertical pixel line, then clip, scale, and apply shading to the  
result accordingly so a perspective is acheived.
drawFunction is always drawImage(ctx, image)
arg is an Image object to be passed to drawImage

- drawImage(ctx, image)
Draws the image in the context ctx with a shadow, or if the image is  
not yet loaded, draws a grey box instead.

Hope someone could help me find the issue for this.
--
定魅刀利
Dimitri Bouniol
dimitri008 at mac.com
http://web.mac.com/dimitri008/





More information about the webkit-dev mailing list