Closed Bug 1540737 Opened 6 years ago Closed 4 years ago

Add layerless painting

Categories

(Core :: Web Painting, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: jrmuizel, Assigned: mattwoodrow)

References

Details

Attachments

(9 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Currently there a couple of cases where we need to use FLB and BasicLayerManager when it's not really providing much value. This includes painting foreign object in masks, background-clip: text and perhaps other uses of nsLayoutUtils::PaintFrame.

Instead, we should be able to paint directly from the display list. Display items can mostly paint themselves, however, container items rely on BasicLayerManger.

For WebRender SVG support we mostly do this except for Fitlers: https://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderCommandBuilder.cpp#890

Having this code path available will let us take special cases out of BasicLayerManager and FrameLayerBuilder and shouldn't be much additional code. We'll also save some cpu time from not having to run FrameLayerBuilder.

Blocks: kill-flb
Priority: -- → P3
Depends on: 1548056
Depends on: 1707513
Assignee: nobody → matt.woodrow
Status: NEW → ASSIGNED

This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Depends on D114675

Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bdb29ecb2b16 Allow filter painting to take a callback for painting children. r=miko https://hg.mozilla.org/integration/autoland/rev/a4f0de44fb08 Implement PushLayerWithBlend for DrawTargetCairo. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/ae15434a35fa Template BSPTree so that it can be used for non-Layers consumers. r=miko https://hg.mozilla.org/integration/autoland/rev/d831680e92b9 Use correct frame size when converting print logical coordinates into physical. r=miko https://hg.mozilla.org/integration/autoland/rev/eeba14b5d89a Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko https://hg.mozilla.org/integration/autoland/rev/00af531b9d94 Don't allow constructing an AutoBuildingDisplayList with a new frame without requiring explicit rects in the new coordinate space. r=miko https://hg.mozilla.org/integration/autoland/rev/62d52e09851e Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko

Backed out for failures on test_bug847890_paintFlashing.html

[task 2021-05-15T23:09:52.688Z] 23:09:52     INFO - TEST-START | layout/base/tests/chrome/test_bug847890_paintFlashing.html
[task 2021-05-15T23:09:52.690Z] 23:09:52     INFO - GECKO(2144) | [Parent 2144, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/chrome/nsChromeRegistry.cpp:180
[task 2021-05-15T23:09:52.691Z] 23:09:52     INFO - GECKO(2144) | [Parent 2144, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/dom/security/nsCSPService.cpp:191
[task 2021-05-15T23:09:52.731Z] 23:09:52     INFO - GECKO(2144) | [Parent 2144, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp:1449
[task 2021-05-15T23:09:53.433Z] 23:09:53     INFO - TEST-INFO | started process screentopng
[task 2021-05-15T23:09:53.857Z] 23:09:53     INFO - TEST-INFO | screentopng: exit 0
[task 2021-05-15T23:09:53.859Z] 23:09:53     INFO - TEST-UNEXPECTED-FAIL | layout/base/tests/chrome/test_bug847890_paintFlashing.html | windows are different 
[task 2021-05-15T23:09:53.859Z] 23:09:53     INFO - SimpleTest.ok@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:417:16
[task 2021-05-15T23:09:53.860Z] 23:09:53     INFO - startTest/</</<@chrome://mochitests/content/chrome/layout/base/tests/chrome/test_bug847890_paintFlashing.html:21:15
[task 2021-05-15T23:09:53.861Z] 23:09:53     INFO - waitForPaints@chrome://mochikit/content/tests/SimpleTest/paint_listener.js:90:14
[task 2021-05-15T23:09:53.862Z] 23:09:53     INFO - waitForPaints/<@chrome://mochikit/content/tests/SimpleTest/paint_listener.js:77:22
[task 2021-05-15T23:09:53.863Z] 23:09:53     INFO - GECKO(2144) | MEMORY STAT | vsize 3384MB | residentFast 455MB | heapAllocated 192MB
[task 2021-05-15T23:09:53.864Z] 23:09:53     INFO - TEST-OK | layout/base/tests/chrome/test_bug847890_paintFlashing.html | took 760ms
Flags: needinfo?(matt.woodrow)
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13f70dfa4e1d Allow filter painting to take a callback for painting children. r=miko https://hg.mozilla.org/integration/autoland/rev/281d90deca41 Implement PushLayerWithBlend for DrawTargetCairo. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/1d871cd13fe6 Template BSPTree so that it can be used for non-Layers consumers. r=miko https://hg.mozilla.org/integration/autoland/rev/588baad5dedf Use correct frame size when converting print logical coordinates into physical. r=miko https://hg.mozilla.org/integration/autoland/rev/b6cdabe5e4d1 Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko https://hg.mozilla.org/integration/autoland/rev/2be59ae8b677 Don't allow constructing an AutoBuildingDisplayList with a new frame without requiring explicit rects in the new coordinate space. r=miko https://hg.mozilla.org/integration/autoland/rev/1acd457d71dc Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
Flags: needinfo?(matt.woodrow)

Backed out for causing mochitest failures on test_reftests_with_caret.html.

Push with failures

Failure log

Backout link

Flags: needinfo?(matt.woodrow)
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b4c93d182ef4 Allow filter painting to take a callback for painting children. r=miko https://hg.mozilla.org/integration/autoland/rev/2f5b8369d061 Implement PushLayerWithBlend for DrawTargetCairo. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/f929de495b87 Template BSPTree so that it can be used for non-Layers consumers. r=miko https://hg.mozilla.org/integration/autoland/rev/b3d0cc460b24 Use correct frame size when converting print logical coordinates into physical. r=miko https://hg.mozilla.org/integration/autoland/rev/81f1a9d1a5e1 Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko https://hg.mozilla.org/integration/autoland/rev/a73e041f1f1d Don't allow constructing an AutoBuildingDisplayList with a new frame without requiring explicit rects in the new coordinate space. r=miko https://hg.mozilla.org/integration/autoland/rev/4b5f53d5127b Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko https://hg.mozilla.org/integration/autoland/rev/37628894ffd5 Override the building rect for nsDisplayCaret since the overflow rect of the frame doesn't include it. r=tnikkel
Flags: needinfo?(matt.woodrow)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 90 Branch → ---
Flags: needinfo?(matt.woodrow)
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/33dbc637a003 Allow filter painting to take a callback for painting children. r=miko https://hg.mozilla.org/integration/autoland/rev/b6f33666cf87 Implement PushLayerWithBlend for DrawTargetCairo. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/c51dd1e9bf2d Template BSPTree so that it can be used for non-Layers consumers. r=miko https://hg.mozilla.org/integration/autoland/rev/36685908dce5 Use correct frame size when converting print logical coordinates into physical. r=miko https://hg.mozilla.org/integration/autoland/rev/b091009018d3 Don't use nsDisplayBorder's IsInvisibleInRect implementation for nsMathMLmtable, since it uses a custom style context. r=miko https://hg.mozilla.org/integration/autoland/rev/fdee5a641aee Don't allow constructing an AutoBuildingDisplayList with a new frame without requiring explicit rects in the new coordinate space. r=miko https://hg.mozilla.org/integration/autoland/rev/1f86740dbf1a Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko https://hg.mozilla.org/integration/autoland/rev/445bc0de5112 Override the building rect for nsDisplayCaret since the overflow rect of the frame doesn't include it. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/411d3031b1b4 Don't use PushLayerWithBlend since it's not implemented by all backend. r=jrmuizel
Flags: needinfo?(matt.woodrow)
Depends on: 1712177
Regressions: 1712177
Regressions: 1714944
No longer regressions: 1714513
Regressions: 1715803
No longer regressions: 1715803
Regressions: 1715803
Regressions: 1720621
Regressions: 1720622
Regressions: 1720719
Regressions: 1720995
Regressions: 1720998
Regressions: 1722457
Regressions: 1722490
Regressions: 1722950
Regressions: 1722281
Regressions: 1726663
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: