[Webkit-unassigned] [Bug 165644] Canvas flickers when scrolling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 8 19:18:16 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=165644

--- Comment #2 from Joseph Pecoraro <joepeck at webkit.org> ---
The page has a rAF draw loop for the logo:

> function main (time) {
> 	fixdim()
> 	ctx.clearRect(0,0,canvas.width,canvas.height)
> 
> 	var t = time/10000
> 	ctx.strokeStyle = ctx.fillStyle = color
> 	var sm = 1
> 	var m = tesseractwithrotation(t, t*2, t*3, mouse.x/100, mouse.y/100, 0)
> 	drawtesseract(ctx, m, {
> 		x: canvas.width/2, 
> 		y: canvas.height/2, 
> 		size: gh*canvas.height, 
> 		line_width: 2,
> 	})
> 
> 	lasttime = time
> 	requestAnimationFrame(main)
> }

It seems as if the fixdim() is causing this issue in Safari when it sets the canvas.width and canvas.height to values that end up not changing. When that happens WebKit clears the canvas.

Fortunately the code has a global variable "freeze" that you can set to true and it skips this code. When set the canvas no longer flickers.

So perhaps we should be smarter when setting the width/height of a canvas to a value that ultimately doesn't cause a change.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161209/63f3139b/attachment-0001.html>


More information about the webkit-unassigned mailing list