Not repainting properly on canvas animation

RESOLVED FIXED

Status

()

Core
Canvas: 2D
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: sicking, Assigned: vlad)

Tracking

({regression})

Trunk
regression
Points:
---
Bug Flags:
blocking1.9.2 +

Firefox Tracking Flags

(status1.9.2 beta4-fixed)

Details

(URL)

Attachments

(1 attachment)

(this time i'm sure the page is using canvas :) )

On the following page:

http://nutt.im/waves/2e3b7ba6414e0e3f3a727c63ca1f37d159baf22f/index.html

Sometimes rendering turds are left in the upper left hand side corner. Steps to reproduce:

1. Load url
2. Wait for darkest wave to go all the way up in the upper left corner
3. Look closely as the wave is going down.

The turds vary in size, if you watch for a while some very obvious turds should appear.

This seems to be a regressions since 3.5
Flags: blocking1.9.2?
Page is using w/h 100% on the canvas element, which it attempts to set to the innerWidth/innerHeight of the window using an inline <script> after the canvas is created.  I don't think that's related.

Instead, I think that the problem is the "drawn region" computation isn't rounding out properly.  I'll look at this on Monday; I think it needs to block, and the patch should be a simple one.
Assignee: nobody → vladimir
Flags: blocking1.9.2? → blocking1.9.2+
Created attachment 412939 [details] [diff] [review]
Redraw on SetDimensions

So the bug here is that this testcase is using "canvas.width = canvas.width;" at the start of its draw loop as a way to clear/reset the canvas.  This is evil and horrible, but it's supposed to work (I'm going to file a separate bug to optimize this -- right now we always create a new surface, when we should be able to just clear the old one).  Before my optimized invalidation changes, the next time that canvas would be drawn into, the whole thing would get invalidated and all would be good.  But after, only the newly drawn portion got invalidated, so the entire canvas wasn't repainted, even though it's now fully transparent, leaving turds behind.

This patch just forces a full invalidate on every InitWithSurface call (which SetDimensions calls).
Attachment #412939 - Flags: review?(roc)
Attachment #412939 - Flags: review?(roc) → review+
http://hg.mozilla.org/mozilla-central/rev/a3fc1f6c5ab3
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/d0c7fc570b4c
status1.9.2: --- → final-fixed
You need to log in before you can comment on or make changes to this bug.