Closed
Bug 1055585
Opened 10 years ago
Closed 10 years ago
Add support for clearing window contents behind themed frames with certain -moz-appearance values
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(5 files)
4.41 KB,
patch
|
roc
:
review+
roc
:
feedback+
|
Details | Diff | Splinter Review |
2.86 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
3.36 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
1.10 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
2.61 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
This is for the Mac OS 10.10 behind-window vibrancy style (bug 1051522), which looks similar to the Windows glass effect. It's primarily used for sidebars.
Vibrancy works by declaring vibrant regions to the window server, and during painting, clearing the background of these areas and painting any contents into full transparency.
I'd like a way for nsITheme to tell layers "Please clear the window background behind this widget". Then we can put vibrant widgets onto any opaque widget in the window, and our stylesheets don't have to make sure that the stuff that's behind the widget is also transparent. It also means that the window itself won't have to be transparent, so things that are outside the vibrant parts still know that they paint onto something opaque. (I'm not really sure how this part works with glass.)
My suggested approach is to add an nsITheme API, nsITheme::NeedToClearBackgroundBehindWidget, and a new display item nsDisplayClearBackground, which translates into a transparent ColorLayer that has a blend mode of OP_SOURCE. Then we declare that background clearing is only supported if the stacking context around the widget is the window itself and forget about the hard cases.
Does that sound like a sensible approach?
Assignee | ||
Comment 1•10 years ago
|
||
This adds nsDisplayClearBackground. nsDisplayClearBackground is opaque in the sense that it doesn't matter what's painted behind it.
I think the parent layer scale comment in the patch probably isn't worth worrying about, because if there's a parent layer then it won't work anyway because it's not directly drawing into the window.
Attachment #8475218 -
Flags: feedback?(roc)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8475220 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8475221 -
Flags: review?(roc)
Assignee | ||
Comment 4•10 years ago
|
||
It seems this got broken at some point. At the moment, the only caller of this is only calling it if there already is an nsDisplayList that NeedsTransparentSurface().
I also don't know if this is a good place to add the call. Thoughts?
Attachment #8475224 -
Flags: review?(roc)
Assignee | ||
Comment 5•10 years ago
|
||
The purpose of part 3 and 4 is to flag the root ContainerLayer as not supporting component alpha children, because 2-pass component alpha layer rendering simply doesn't work on top of transparent window backgrounds.
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8475218 -
Attachment description: add-displayclearbackground → part 1: Add nsDisplayClearBackground
This is very similar to Windows' nsWindow::UpdateThemeGeometries, which calls LayerManager::SetRegionToClear, which should work on GL too. Can you use that approach instead?
Flags: needinfo?(mstange)
Assignee | ||
Comment 8•10 years ago
|
||
I think that will clear a region in the final composited result, whereas I'd like to clear between painting the window background and the sidebar foreground.
Flags: needinfo?(mstange)
Hmm, OK.
Attachment #8475218 -
Flags: review+
Attachment #8475218 -
Flags: feedback?(roc)
Attachment #8475218 -
Flags: feedback+
Comment on attachment 8475224 [details] [diff] [review]
part 4: Call nsDisplayList::SetNeedsTransparentSurface
Review of attachment 8475224 [details] [diff] [review]:
-----------------------------------------------------------------
This probably got lost during a rebase or something.
Attachment #8475224 -
Flags: review?(roc) → review+
Attachment #8475221 -
Flags: review?(roc) → review+
Assignee | ||
Updated•10 years ago
|
Attachment #8475227 -
Flags: review?(roc)
Attachment #8475227 -
Flags: review?(roc) → review+
Comment 11•10 years ago
|
||
Comment on attachment 8475220 [details] [diff] [review]
part 2: Support operator source in CompositorOGL
Review of attachment 8475220 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the default dstBlendAlpha value fixed.
::: gfx/layers/opengl/CompositorOGL.cpp
@@ +976,5 @@
> }
>
> GLenum srcBlend;
> GLenum dstBlend;
> + GLenum dstBlendAlpha = LOCAL_GL_ONE_MINUS_SRC_ALPHA;
Shouldn't this just be LOCAL_GL_ONE?
Attachment #8475220 -
Flags: review?(matt.woodrow) → review+
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8475220 [details] [diff] [review]
part 2: Support operator source in CompositorOGL
oops yes
Assignee | ||
Comment 13•10 years ago
|
||
I had to merge part 2 on top of bug 1002823 which added OP_SOURCE support to SetBlendMode just before me, but with bad variable names (I think) and without the aIsPremultiplied check.
https://hg.mozilla.org/integration/mozilla-inbound/rev/728d6583d8d8
https://hg.mozilla.org/integration/mozilla-inbound/rev/ff5178d4e9f9
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6e68c3679e0
https://hg.mozilla.org/integration/mozilla-inbound/rev/35e778ffed08
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d4e2c22ed89
Comment 14•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/728d6583d8d8
https://hg.mozilla.org/mozilla-central/rev/ff5178d4e9f9
https://hg.mozilla.org/mozilla-central/rev/e6e68c3679e0
https://hg.mozilla.org/mozilla-central/rev/35e778ffed08
https://hg.mozilla.org/mozilla-central/rev/7d4e2c22ed89
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•