Using the luminosity globalCompositeOperation in combination with other globalCompositeOperations causes rendering errors
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
People
(Reporter: george, Assigned: lsalzman)
References
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta-
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
Steps to reproduce:
I can reproduce by following these steps:
- create a canvas element and insert an image with drawImage
- set globalCompositeOperation to "saturation" and fill the canvas with #000
- set globalCompositeOperation to "luminosity" and globalAlpha to 0.5 and fill the canvas with #fff
Where the desaturation layer and luminosity layer overlap, a rendering error occurs
This codepen contains a recreatable example https://codepen.io/GBro/pen/gOvwGod?editors=0010
Actual results:
On the Windows version of Firefox, it was rendered correctly.
On the Mac OSX version of Firefox (user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0), the resultant image has a speckling effect, with black and white spots dotted around the image where the two globalCompositerOperation effects overlap.
Expected results:
The canvas should display a desaturated and brightened version of the original image
Comment 2•2 years ago
•
|
||
Same thing happens on Linux. Difference may be caused by D2D vs Skia.
If you change gfx.canvas.azure.backends
to be just skia
, does it reproduce on Windows? (Requires restart)
Reporter | ||
Comment 3•2 years ago
|
||
(In reply to Andrew Osmond [:aosmond] (he/him) from comment #2)
Same thing happens on Linux. Difference may be caused by D2D vs Skia.
If you change
gfx.canvas.azure.backends
to be justskia
, does it reproduce on Windows? (Requires restart)
Yep, same issue occurs for me on Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0 after making that config change
Comment 4•2 years ago
|
||
Bug in Skia or DrawTargetSkia?
Assignee | ||
Comment 5•2 years ago
|
||
This bug is in Skia. It reproduces in Chromium if you disable hardware acceleration there. They fixed it in Skia's GPU pipeline, but not in the software pipeline.
Assignee | ||
Comment 6•2 years ago
|
||
I filed an upstream Skia bug: https://bugs.chromium.org/p/skia/issues/detail?id=13417
Assignee | ||
Comment 7•2 years ago
|
||
This applies a fix that is present in Skia's HW luminosity blend mode to its
CPU pipeline so that the luminosity mode no longer divides by zero, thus avoiding
infs and nans.
Updated•2 years ago
|
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f292760857f2 Avoid divide-by-zero in Skia's luminosity blend mode. r=jrmuizel,gfx-reviewers
Comment 9•2 years ago
•
|
||
Backed out for causing build bustages at SkRasterPipeline_opts.
Backout link: https://hg.mozilla.org/integration/autoland/rev/c2d1bef38ec87e21737e12a69009019dbc93b957
Push where failures started: https://treeherder.mozilla.org/jobs?repo=autoland&selectedTaskRun=OZoz5UjXSMCDwfU4UJHdew.0&resultStatus=testfailed%2Cbusted%2Cexception&revision=fe7b745e73f1a3fc88b0328ab5c4bf01d82486eeq
Failure log: https://treeherder.mozilla.org/logviewer?job_id=381498580&repo=autoland&lineNumber=14453
Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d845c981228 Avoid divide-by-zero in Skia's luminosity blend mode. r=jrmuizel,gfx-reviewers
Comment 11•2 years ago
|
||
bugherder |
Comment 12•2 years ago
|
||
The patch landed in nightly and beta is affected.
:lsalzman, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox102
towontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 13•2 years ago
|
||
Comment on attachment 9280894 [details]
Bug 1769082 - Avoid divide-by-zero in Skia's luminosity blend mode. r?jrmuizel
Beta/Release Uplift Approval Request
- User impact if declined: Visual artifacts when using the luminosity blend mode in CSS or Canvas.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- 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): Fix accepted by upstream Skia.
- String changes made/needed:
- Is Android affected?: Yes
Assignee | ||
Updated•2 years ago
|
Comment 14•2 years ago
|
||
Comment on attachment 9280894 [details]
Bug 1769082 - Avoid divide-by-zero in Skia's luminosity blend mode. r?jrmuizel
This is landing too late to take into our last beta, sorry.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•