Large Image fails to load when using the Image constructor.
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
People
(Reporter: stu210239, Assigned: bobowen)
References
(Regression)
Details
(Keywords: parity-chrome, platform-parity, regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
On Windows 10 build 19043.1348, firefox version >=86
load the MNIST handwritten digit sprite file from https://storage.googleapis.com/learnjs-data/model-builder/mnist_images.png via the Image() constructor and then draw the ImageData on a canvas using drawImage.
See the attached index.html for an example.
Actual results:
The canvas is black, instead of showing the sprite file.
Expected results:
Draw the sprite file (or part of it) on the canvas.
Up to firefox 86 this worked and still works in most other browsers.
Updated•3 years ago
|
Comment hidden (obsolete) |
Comment 2•3 years ago
|
||
Regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=17e3c9ff2cad9711445a6c39df85925c8f347336&tochange=afa247928245d02b1305a1850eb39f19b84a2f35
This is much earlier than Firefox 85 for me.
Comment 3•3 years ago
|
||
Comment 4•3 years ago
|
||
Confirmed that the testcase works if gfx.canvas.remote
is false
(restart required).
Since remote 2D canvas has been enabled since Firefox 86 in release (bug 1687276), it explains reporter's regression range.
Updated•3 years ago
|
Updated•3 years ago
|
I can confirm that with gfx.canvas.remote
set to false
, the real usecase, being machine learning on the MNIST dataset with tensorflow.js, works again.
Assignee | ||
Comment 7•3 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #6)
:bobowen, can you comment to the bug?
My guess is that when we are calling DrawTargetD2D1::DrawSurface (in the content process) it only creates an image to fill the canvas.
For DrawTargetRecording::DrawSurface, it records the entire surface, but that fails to be created in the GPU process, because it is too big.
So, I guess we should check to see if the surface is bigger than the canvas and if it is just create a separate surface, just for this draw, that is truncated to the width and height of the canvas.
Updated•3 years ago
|
Assignee | ||
Comment 8•3 years ago
|
||
I dug out an old patch that uses the shared memory images in the canvas recording/translation.
It needs a bit more work, but it fixes this issue.
Assignee | ||
Comment 9•3 years ago
|
||
This also changes SharedSurfacesParent to use a StaticMonitor, so that we can
wait for the surface to be added.
Depends on D132602
Assignee | ||
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:bobowen, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 12•3 years ago
|
||
(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #11)
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:bobowen, could you have a look please?
For more information, please visit auto_nag documentation.
I was thinking that I ought to try and write a test for this before I land.
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
Backed out 2 changesets (Bug 1741767) for causing assertion failures in DrawTargetD2D1.cpp CLOSED TREE
Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=bc03f747b472d414f1c93ae0c97cdba268824370
Log: https://treeherder.mozilla.org/logviewer?job_id=363649913&repo=autoland&lineNumber=21067
Backout: https://hg.mozilla.org/integration/autoland/rev/8f1047161612d21b6c9798f7731ca620934f5225
Comment 16•3 years ago
|
||
The test triggers the assertion failure even without D132703 when gfx.canvas.remote
is false
. So this is an existing problem.
Comment 17•3 years ago
•
|
||
We hit this assertion when the image is too large to create a D2D1Bitmap.
Bug 1088235 introduced the assertion. Bas, do you have a way round?
Comment 18•3 years ago
|
||
I'll re-land with the test disabled on debug builds if it is not easy to fix the problem because this is an existing problem.
Assignee | ||
Updated•3 years ago
|
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1f75710950a2
https://hg.mozilla.org/mozilla-central/rev/a1cc440f0d95
Updated•3 years ago
|
Description
•