Closed Bug 1378606 Opened 7 years ago Closed 7 years ago

Set correct blend mode for layers-free mode

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: ethlin, Assigned: mtseng)

References

Details

Attachments

(1 file)

Currently we haven't converted nsDisplayBlendMode, so the blend mode may be wrong[1]. I'll add CreateWebRenderCommands for nsDisplayBlendMode and nsDisplayClearBackground in this bug.


[1] https://dxr.mozilla.org/mozilla-central/source/gfx/layers/wr/StackingContextHelper.cpp?q=%22%2F%2F+TODO%3A+set+correct+blend+mode.&redirect_type=single#40
Summary: Set correct blend mode for layers free → Set correct blend mode for layers-free mode
I have a patch for nsDisplayBlendMode. But the result is right only if the html is inside another iframe. I suspect this might related to some stacking context problem in webrender. I'll investigate this.
I'll focus on nsDisplayBlendMode and nsDisplayBlendContainer in this bug. nsDisplayClearBackground should be handled by another bug.
Steal bug from Ethan.
Assignee: ethlin → mtseng
Comment on attachment 8892344 [details]
Bug 1378606 - Support mix-blend-mode in layers-free mode.

https://reviewboard.mozilla.org/r/163312/#review168742

::: layout/painting/nsDisplayList.cpp:6331
(Diff revision 1)
> +  nsRect itemBounds = mList.GetClippedBoundsWithRespectToASR(aDisplayListBuilder, mActiveScrolledRoot);
> +  nsRect childrenVisible = GetVisibleRectForChildren();
> +  nsRect visibleRect = itemBounds.Intersect(childrenVisible);
> +  float appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
> +  LayerRect bounds = ViewAs<LayerPixel>(LayoutDeviceRect::FromAppUnits(visibleRect, appUnitsPerDevPixel),
> +                                        PixelCastJustification::WebRenderHasUnitResolution);
> +  LayerPoint origin = bounds.TopLeft();

This stuff is getting duplicated quite a bit. Maybe in a followup bug we can look into pushing it inside the StackingContextHelper constructor.
Attachment #8892344 - Flags: review?(bugmail) → review+
I will have a followup bug to refactor the StackingContextHelper constructor since I also need this for nsDisplayFilter.
Blocks: 1386553
Pushed by mtseng@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3782e1354af
Support mix-blend-mode in layers-free mode.
https://hg.mozilla.org/mozilla-central/rev/e3782e1354af
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: