Closed
Bug 1281593
Opened 9 years ago
Closed 8 years ago
Nested elements with mix-blend-mode and background-image have strange artifact when transformed
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla51
People
(Reporter: shorlander, Assigned: dvander)
References
Details
(Keywords: regression)
Attachments
(4 files, 2 obsolete files)
8.29 KB,
image/png
|
Details | |
17.82 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
3.63 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
1.27 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
I ran into a rendering glitch when I tried to nest an element with mix-blend-mode inside an object with mix-blend-mode and then apply a transform.
Attaching a screenshot.
Top — no transform
Bottom — transform: rotate(45deg);
The bottom image has a grey box that should not be there.
Test case: http://people.mozilla.org/~shorlander/bugs/transform-blend-mode-glitch.html
Only tested this on OS X, not sure what it does on other platforms.
Comment 1•9 years ago
|
||
Flags: needinfo?(dvander)
Keywords: regression
Updated•9 years ago
|
status-firefox47:
--- → wontfix
status-firefox48:
--- → affected
status-firefox49:
--- → affected
status-firefox50:
--- → affected
Version: unspecified → 46 Branch
Comment 2•8 years ago
|
||
Attachment #8772360 -
Flags: review?(dvander)
Comment 3•8 years ago
|
||
Markus: moving r? to you since you reviewed this shader before. Thx!
Attachment #8772360 -
Attachment is obsolete: true
Attachment #8772360 -
Flags: review?(dvander)
Attachment #8773572 -
Flags: review?(mstange)
Assignee | ||
Comment 4•8 years ago
|
||
Sorry, was waiting to test this locally - the fix looks good, but it needs a D3D11 shader fix as well. A reftest would almost certainly pass on Mac and fail on Windows.
Flags: needinfo?(dvander)
Comment 5•8 years ago
|
||
(In reply to David Anderson [:dvander] from comment #4)
> Sorry, was waiting to test this locally - the fix looks good, but it needs a
> D3D11 shader fix as well. A reftest would almost certainly pass on Mac and
> fail on Windows.
No worries. I had to re-work the patch anyway as the comments no longer matched the code. Are you able to port it to D3D? (I'm traveling and don't have a Windows machine.)
Updated•8 years ago
|
Flags: needinfo?(dvander)
Comment 6•8 years ago
|
||
Comment on attachment 8773572 [details] [diff] [review]
Force premultiplied source color to transparent when alpha is 0.
Review of attachment 8773572 [details] [diff] [review]:
-----------------------------------------------------------------
A description of the bug would have helped me understand this patch much more quickly :) For future reference, the problem is that the "if (color.a == 0.0) { return backdrop; }" optimization is just wrong - if color.a is 0.0, then what we return must also have .a == 0.0, and that's not necessarily true for the backdrop.
Actually, writing this down cleared things up for me. Couldn't we just change the early return to return vec4(0.0, 0.0, 0.0, 0.0) instead?
By the way, two of the comments have whitespace at the end of the line.
Attachment #8773572 -
Flags: review?(mstange)
Assignee | ||
Comment 7•8 years ago
|
||
Yeah good point, I think we can just return 0.
Flags: needinfo?(dvander)
Attachment #8775333 -
Flags: review?(mstange)
Assignee | ||
Comment 8•8 years ago
|
||
Attachment #8775334 -
Flags: review?(mstange)
Updated•8 years ago
|
Attachment #8775333 -
Flags: review?(mstange) → review+
Updated•8 years ago
|
Attachment #8775334 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 9•8 years ago
|
||
Jet, I'll just steal this unless you very much want to own a mix-blend bug :) thanks for diagnosing the problem.
Assignee: nobody → dvander
Status: NEW → ASSIGNED
Assignee | ||
Comment 10•8 years ago
|
||
Attachment #8773572 -
Attachment is obsolete: true
Attachment #8775424 -
Flags: review?(mstange)
Comment 11•8 years ago
|
||
Comment on attachment 8775424 [details] [diff] [review]
opengl fix
Review of attachment 8775424 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/opengl/OGLShaderProgram.cpp
@@ +736,5 @@
> fs << " if (backdrop.a == 0.0) {" << endl;
> fs << " return color;" << endl;
> fs << " }" << endl;
> fs << " if (color.a == 0.0) {" << endl;
> + fs << " return vec4(0.0, 0.0, 0.0, 0.0);;" << endl;
double semicolon
Attachment #8775424 -
Flags: review?(mstange) → review+
Comment 12•8 years ago
|
||
Pushed by danderson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d1cec49be7a
Fix D3D11 mix-blending when the source alpha is 0. (bug 1281593 part 1, r=mstange)
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a8ee572051d
Fix OpenGL mix-blending when the source alpha is 0. (bug 1281593 part 2, r=mstange)
https://hg.mozilla.org/integration/mozilla-inbound/rev/0e63d98406fe
Add a reftest for bug 1281593. r=mstange
Comment 13•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d1cec49be7a
https://hg.mozilla.org/mozilla-central/rev/8a8ee572051d
https://hg.mozilla.org/mozilla-central/rev/0e63d98406fe
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment 14•8 years ago
|
||
Are you ok with the fix staying in 51, or do you want to try uplift? Unless you think this is a common problem for users or has a big impact I think it's likely ok to stay in 51.
Flags: needinfo?(dvander)
Assignee | ||
Comment 15•8 years ago
|
||
I think this is okay to not uplift for now, it's pretty obscure.
Flags: needinfo?(dvander)
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•