WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
73228
Synchronization problem in Canvas/WebGLRenderingContext when listener asks for image
https://bugs.webkit.org/show_bug.cgi?id=73228
Summary
Synchronization problem in Canvas/WebGLRenderingContext when listener asks fo...
Dana Jansens
Reported
2011-11-28 10:29:33 PST
If a listener to HTMLCanvasElement contentChanged asks for the current image, the canvas will stop updating its contents forever. Two classes: HTMLCanvasElement || WebGLRenderingContext ----------------------GOOD------------------------------ ask for image here ----> paints onto canvas marks NOT DIRTY (ie nothing new to send to canvas) saves cache <---- ----------------------GOOD------------------------------ new stuff in webgl clears cache <---- marks DIRTY (stuff to be painted in canvas) ----------------------BAD------------------------------- new stuff in webgl clears cache <---- notify people ask for image here ----> paints onto canvas marks NOT DIRTY (ie nothing new to send to canvas) saves cache <---- marks DIRTY (stuff to be painted in canvas) Now there is a cached image, so it will never paint onto canvas again. And the canvas is marked dirty so WebGL will never draw onto it again. Each is waiting for the other.
Attachments
Patch
(1.92 KB, patch)
2011-11-28 10:40 PST
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dana Jansens
Comment 1
2011-11-28 10:40:47 PST
Created
attachment 116780
[details]
Patch
Dana Jansens
Comment 2
2011-11-28 10:44:57 PST
This patch: Since the cached image is cleared before notifying people about the change, mark the canvas dirty before also. This a) keeps them in sync. b) if a listener requests the image, it will cache the requested version correctly. An alternate version of this patch would be to clear the cache and mark dirty after notifying listeners. In b) above, this would throw away the cache and cause extra work in the next request for the image.
Kenneth Russell
Comment 3
2011-11-28 13:41:31 PST
Have you run the preserveDrawingBuffer related tests in fast/canvas/webgl with these changes, both in DRT and in the browser? Have you verified that printing of WebGL content works after this change?
Dana Jansens
Comment 4
2011-11-28 14:13:09 PST
(In reply to
comment #3
)
> Have you run the preserveDrawingBuffer related tests in fast/canvas/webgl with these changes, both in DRT and in the browser?
All of fast/canvas/webgl passes with platform chromium-linux and chromium-gpu. fast/canvas/webgl/premultiplyalpha-test.html passes in the browser.
> Have you verified that printing of WebGL content works after this change?
Printing WebGL aquarium to a PDF worked.
Kenneth Russell
Comment 5
2011-11-28 14:27:54 PST
Comment on
attachment 116780
[details]
Patch OK. The patch looks fine otherwise. r=me
WebKit Review Bot
Comment 6
2011-11-28 17:38:47 PST
Comment on
attachment 116780
[details]
Patch Clearing flags on attachment: 116780 Committed
r101311
: <
http://trac.webkit.org/changeset/101311
>
WebKit Review Bot
Comment 7
2011-11-28 17:38:51 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug