Canvas 2D with Copy + Rotate(0) +Clip fails on Window 10
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox110 | --- | wontfix |
firefox111 | --- | verified |
firefox112 | --- | verified |
People
(Reporter: raffy, Assigned: jrmuizel)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
8.92 KB,
image/png
|
Details | |
724 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Steps to reproduce:
function test(rot) {
let canvas = document.createElement('canvas');
canvas.style.border = '1px solid #000';
canvas.width = canvas.height = 200;
let ctx = canvas.getContext('2d');
ctx.globalCompositeOperation = 'copy';
ctx.translate(100, 100);
ctx.rotate(rot);
ctx.rect(-50, -50, 100, 100);
ctx.clip();
ctx.fillStyle = '#f00';
ctx.resetTransform();
ctx.fillRect(0, 0, canvas.width, canvas.height);
return canvas;
}
// works correctly
test(0.0001)
test(0.2)
// bugged
test(0)
test(Math.PI/2)
test(Math.PI)
Actual results:
When using composition "copy" with rotation at right angles, the clip region is ignored.
Expected results:
The clip region should be expected in all cases.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1804952
:jrmuizel, since you are the author of the regressor, bug 1804952, could you take a look? Also, could you set the severity field?
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
I think this is exposing an existing bug in the D2D backend.
Assignee | ||
Comment 4•1 year ago
|
||
I think the bug may have been caused by https://hg.mozilla.org/mozilla-central/rev/538d248fa252
Assignee | ||
Comment 5•1 year ago
|
||
This ensures that we have our clips pushed when we expect them to.
Pushed by jmuizelaar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7b8c57a5cba Fix drawing of some blend modes with non-complex clips. r=bas
Assignee | ||
Comment 7•1 year ago
|
||
Comment on attachment 9320840 [details]
Bug 1818820. Fix drawing of some blend modes with non-complex clips.
Beta/Release Uplift Approval Request
- User impact if declined: Sometimes we ignore the clip in canvas
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The common paths in canvas are quite well tested so if this introduces a problem it's likely to be rare.
- String changes made/needed:
- Is Android affected?: No
Comment 8•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment on attachment 9320840 [details]
Bug 1818820. Fix drawing of some blend modes with non-complex clips.
Approved for 111.0 RC1
Comment 11•1 year ago
|
||
bugherder uplift |
Reporter | ||
Comment 12•1 year ago
|
||
Impressive work Mozilla team. Thanks for the quick fix!
I apologize for the poorly formatted report and lack of one-click demo. It was my first bug report and I didn't know I could use markdown or provide an inline attachment.
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Reproduced the issue on Win10x64 using 110.0a1(20230105213109).
Verified as fixed on Win10x64/Ubuntu20.04/Mac10.13 using 112.0a1(20230306094520) and 111.0(20230306162820).
Description
•