Open Bug 742081 Opened 9 years ago Updated 5 years ago

WebGL texture load broken does not work after bug 740841


(Core :: ImageLib, defect)

14 Branch
Not set




(Reporter: romaxa, Unassigned)


(Blocks 1 open bug)


(Keywords: regression)


(2 files)

I see that webgl stopped working after landing fix from bug 740841
we always return with error on this condition:
because mDecoder is not null
So if we are asked to decode with different flags and we have a decoder already then should we shutdown the existing decoder and start a new one with the requested flags?
I backed out bug 740841 for now.
Attached patch fix?Splinter Review
Something like this seems to fix it. But I didn't do my homework on imglib to see if this is 100% kosher.
Attachment #612124 - Flags: feedback?(joe)
Testcase that I'm using for testing that I got from Oleg:
Comment on attachment 612124 [details] [diff] [review]

this works fine for me too
Attachment #612124 - Flags: feedback+
Comment on attachment 612124 [details] [diff] [review]

oh, no, tested it carefully, and found that textures now corrupted on half... sounds like we interrupting decoding and getting broken texture at the end
Attachment #612124 - Flags: feedback+ → feedback-
Attachment #612124 - Flags: feedback?(joe)
Sadly that makes sense. If there is a decoder already that means there is probably another consumer around of the same image but who wants different decode flags.
If we're already doing an asynchronous decode, and we want to do a synchronous decode for a different pixel format, we are in for a real heap of trouble, since the other decoders are waiting on notifications from the decode.

If we have all of the image data, we're OK: we can flush all the data to the decoder synchronously, shut it down, and then open a new decoder for the new format.

If we don't have all the image data, we should just refuse to fulfill the request.
If we don't have all the data, I'd think the webgl code should not be asking for it to start with.  Certainly 2d canvas is supposed to silently do nothing when asked to draw a still-loading image.
Version: Trunk → 14 Branch
You need to log in before you can comment on or make changes to this bug.