It's expensive to traverse the whole layer tree for compositing updates, and when only a portion of the tree has changed, this is wasted work. We should try to do incremental updates when possible.
Attachment 150323[details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/ChangeLog:10: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5]
Total errors found: 1 in 7 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Attachment 352389[details] did not pass style-queue:
ERROR: Source/WebCore/rendering/RenderLayer.h:216: Place brace on its own line for function definitions. [whitespace/braces] [4]
ERROR: Source/WebCore/rendering/RenderLayer.h:225: Place brace on its own line for function definitions. [whitespace/braces] [4]
ERROR: Source/WebCore/rendering/RenderLayerCompositor.cpp:971: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3]
ERROR: Source/WebCore/rendering/RenderLayerCompositor.cpp:1050: One line control clauses should not use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/rendering/RenderLayerCompositor.cpp:3001: Should have a space between // and comment [whitespace/comments] [4]
ERROR: Source/WebCore/rendering/RenderLayerCompositor.cpp:3058: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3]
Total errors found: 6 in 9 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 352400[details]
Archive of layout-test-results from ews102 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352403[details]
Archive of layout-test-results from ews104 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352409[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352413[details]
Archive of layout-test-results from ews116 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352423[details]
Archive of layout-test-results from ews100 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352427[details]
Archive of layout-test-results from ews107 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352430[details]
Archive of layout-test-results from ews117 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352431[details]
Archive of layout-test-results from ews125 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352439[details]
Archive of layout-test-results from ews113 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352441[details]
Archive of layout-test-results from ews102 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352442[details]
Archive of layout-test-results from ews106 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352443[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352444[details]
Archive of layout-test-results from ews113 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352489[details]
Archive of layout-test-results from ews103 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352501[details]
Archive of layout-test-results from ews114 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352505[details]
Archive of layout-test-results from ews123 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352579[details]
Archive of layout-test-results from ews100 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352586[details]
Archive of layout-test-results from ews107 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352595[details]
Archive of layout-test-results from ews112 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352665[details]
Archive of layout-test-results from ews122 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352716[details]
Archive of layout-test-results from ews101 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352718[details]
Archive of layout-test-results from ews106 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352722[details]
Archive of layout-test-results from ews113 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 352724[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352871[details]
Archive of layout-test-results from ews105 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352872[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Attachment 353585[details] did not pass style-queue:
ERROR: /Volumes/Data/StyleQueue/WebKit/LayoutTests/platform/mac-wk1/TestExpectations:654: More specific entry for compositing/repaint/iframes/compositing-iframe-scroll-repaint.html on line LayoutTests/platform/mac-wk1/TestExpectations:627 overrides line LayoutTests/platform/mac-wk1/TestExpectations:654. [test/expectations] [5]
Total errors found: 1 in 19 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 353586[details]
Archive of layout-test-results from ews112 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 353587[details]
Archive of layout-test-results from ews105 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 354105[details]
Archive of layout-test-results from ews104 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 354109[details]
Archive of layout-test-results from ews113 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
Created attachment 354421[details]
Archive of layout-test-results from ews104 for mac-sierra-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Attachment 354491[details] did not pass style-queue:
ERROR: Source/WebCore/rendering/RenderLayer.h:397: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5]
Total errors found: 1 in 25 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Attachment 354508[details] did not pass style-queue:
ERROR: Source/WebCore/rendering/RenderLayer.h:397: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5]
Total errors found: 1 in 29 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 354510[details]
Archive of layout-test-results from ews126 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Comment on attachment 354508[details]
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=354508&action=review
r=me, nice!
> Source/WebCore/ChangeLog:33
> + These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
> + more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
> + triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
> + excluding composited filters from the composited bounds (but still taking them into account for overlap).
Do we have some performance tests that progress?
> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:2162
> + if (madeLayer) {
> updateBackdropFiltersRect();
> + noteSublayersChanged(DontScheduleFlush);
> + }
Why not schedule a flush?
> Source/WebCore/rendering/RenderLayer.cpp:279
> , m_forcedStackingContext(rendererLayerModelObject.isMedia())
> , m_zOrderListsDirty(false)
> , m_normalFlowListDirty(true)
> + , m_hadNegativeZOrderList(false)
> , m_inResizeMode(false)
> , m_scrollDimensionsDirty(true)
> , m_hasSelfPaintingLayerDescendant(false)
Would be nice to turn these into normal bools (or OptionSets) at some point. Pretty sure memory optimization from bitfields is not meaningful.
> Source/WebCore/rendering/RenderLayer.cpp:617
> + RenderLayer* layer = parent();
auto*
> Source/WebCore/rendering/RenderLayer.h:197
> + enum CompositingStateFlag {
You might consider making this 'enum class CompositingState', 'CompositingFlag' or just 'Compositing' and dropping the then redundant word 'Compositing' from the value names.
> Source/WebCore/rendering/RenderLayer.h:256
> + bool needsPostLayoutCompositingUpdate() const { return m_compositingDirtyBits.contains(NeedsPostLayoutCompositingUpdate); }
Not sure how all these accessors are better than making the enum public and exposing m_compositingDirtyBits via const accessor. They are not used that much.
> Source/WebCore/rendering/RenderLayer.h:261
> + void setNeedsPostLayoutCompositingUpdate()
> + {
> + m_compositingDirtyBits.add(NeedsPostLayoutCompositingUpdate);
> + setAncestorsHaveCompositingDirtyFlag(HasDescendantNeedingCompositingRequirementsTraversal);
> + }
Do all these really need to be in the header? It is already big.
> Source/WebCore/rendering/RenderLayerBacking.cpp:629
> } else
> m_artificiallyInflatedBounds = false;
>
> - setCompositedBounds(layerBounds);
> + return setCompositedBounds(layerBounds);
Could m_artificiallyInflatedBounds change even when the computed bounds stay the same? Should we return true in that case?
> Source/WebCore/rendering/RenderLayerBacking.cpp:661
> +// This can only update things that don't require up-to-date layout.
> +void RenderLayerBacking::updateConfigurationAfterStyleChange()
updateConfigurationAfterStyleChangeWithoutRequiringUpToDateLayout? :D
> Source/WebCore/rendering/RenderLayerCompositor.cpp:227
> + , fullPaintOrderTraversalRequired(false)
> + , descendantsRequireCompositingUpdate(false)
> , ancestorHasTransformAnimation(false)
These could be switched to modern initialization.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:657
> +// Returns true on a successful update.
> bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
enum return value would avoid the comment.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:661
> + UNUSED_PARAM(updateType);
> + UNUSED_PARAM(updateRoot);
Neither of these parameters is unused.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:691
> + // Scrolling can affect overlap. FIXME: avoid for page scrolling.
> + updateRoot->setDescendantsNeedCompositingRequirementsTraversal();
Sounds like a big FIXME!
> Source/WebCore/rendering/RenderLayerCompositor.cpp:697
> + if (!updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() && !m_compositing) {
> + LOG_WITH_STREAM(Compositing, stream << " no compositing work to do");
> return false;
> + }
Why is this case considered 'unsuccessful'...
> Source/WebCore/rendering/RenderLayerCompositor.cpp:702
> + if (!updateRoot->needsAnyCompositingTraversal()) {
> + LOG_WITH_STREAM(Compositing, stream << " updateRoot has no dirty child and doesn't need update");
> + return true;
> + }
while this is considered 'successful'.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:802
> + compositingState.fullPaintOrderTraversalRequired |= layer.needsCompositingRequirementsTraversal();
> + compositingState.descendantsRequireCompositingUpdate |= layer.descendantsNeedCompositingRequirementsTraversal();
Using bit operators like this is slightly ugly.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:1019
> +// We have to traverse unchanged layers to fill in the overlap map.
> +void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
Can results of this traversal be cached? Presumably the results don't change if the layers are unchanged.
> Source/WebCore/rendering/RenderLayerCompositor.cpp:1252
> +void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer& layer)
> +{
> + // Inform the inspector that the given RenderLayer was destroyed.
> + InspectorInstrumentation::renderLayerDestroyed(&page(), layer);
Something here seems like a lie. Was the layer destroyed or did it just become non-composited?
> Source/WebCore/rendering/RenderLayerCompositor.h:142
> + struct CompositingQueryData {
This seems to introduce concept of "compositing query" but there are no functions or anything else referencing this concept, so it is bit difficult to understand how it is used.
> Source/WebCore/rendering/RenderLayerCompositor.h:144
> + RenderLayer::ViewportConstrainedNotCompositedReason nonCompositedForPositionReason { RenderLayer::NoNotCompositedReason };
NoNotCompositedReason :(
> Source/WebCore/rendering/RenderLayerCompositor.h:351
> + bool needsToBeComposited(const RenderLayer&, CompositingQueryData&) const;
> // Whether the layer has an intrinsic need for compositing layer.
> - bool requiresCompositingLayer(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
> + bool requiresCompositingLayer(const RenderLayer&, CompositingQueryData&) const;
It is bit unclear if CompositingQueryData is an input, output or both for number of functions that take it. Could it be a (perhaps optional) return value when it is a pure output? Many clients initialize it in stack and invoke some function without doing anything between.
> Source/WebCore/rendering/RenderLayerCompositor.h:379
> + enum class UpdateLevel {
> + AllDescendants = 1 << 0,
> + CompositedChildren = 1 << 1,
> + };
> // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
> - void rebuildCompositingLayerTree(RenderLayer&, Vector<Ref<GraphicsLayer>>& childGraphicsLayersOfEnclosingLayer, int depth);
> + void updateBackingAndHierarchy(RenderLayer&, Vector<Ref<GraphicsLayer>>& childGraphicsLayersOfEnclosingLayer, OptionSet<UpdateLevel> = { }, int depth = 0);
Why OptionSet? Doesn't 'AllDescendants' also cover 'CompositedChildren'? The logic might read better with a regular 3-value enum.
Comment on attachment 354508[details]
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=354508&action=review> Source/WebCore/rendering/RenderLayer.cpp:690
> + if (hasNegativeZOrderList != m_hadNegativeZOrderList) {
> + m_hadNegativeZOrderList = hasNegativeZOrderList;
The bit seems the reflect the current state so maybe m_has instead of m_had?
> Source/WebCore/rendering/RenderLayer.h:1180
> + OptionSet<CompositingStateFlag> m_compositingDirtyBits;
Are these "state flags" or "dirty bits"? It would be nice if the type name and the field name matched.
(In reply to Antti Koivisto from comment #97)
> Comment on attachment 354508[details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=354508&action=review
>
> r=me, nice!
>
> > Source/WebCore/ChangeLog:33
> > + These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
> > + more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
> > + triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
> > + excluding composited filters from the composited bounds (but still taking them into account for overlap).
>
> Do we have some performance tests that progress?
Yes, MotionMark shows it on the Focus test.
> > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:2162
> > + if (madeLayer) {
> > updateBackdropFiltersRect();
> > + noteSublayersChanged(DontScheduleFlush);
> > + }
>
> Why not schedule a flush?
We're already inside a flush here.
> > Source/WebCore/rendering/RenderLayer.cpp:279
> > , m_forcedStackingContext(rendererLayerModelObject.isMedia())
> > , m_zOrderListsDirty(false)
> > , m_normalFlowListDirty(true)
> > + , m_hadNegativeZOrderList(false)
> > , m_inResizeMode(false)
> > , m_scrollDimensionsDirty(true)
> > , m_hasSelfPaintingLayerDescendant(false)
>
> Would be nice to turn these into normal bools (or OptionSets) at some point.
> Pretty sure memory optimization from bitfields is not meaningful.
Some pages can have thousands of RenderLayers, so I think some amount of space optimization is worthwhile.
C++17 (?) gives us initializers for bitfields.
> > Source/WebCore/rendering/RenderLayer.h:197
> > + enum CompositingStateFlag {
>
> You might consider making this 'enum class CompositingState',
> 'CompositingFlag' or just 'Compositing' and dropping the then redundant word
> 'Compositing' from the value names.
>
> > Source/WebCore/rendering/RenderLayer.h:256
> > + bool needsPostLayoutCompositingUpdate() const { return m_compositingDirtyBits.contains(NeedsPostLayoutCompositingUpdate); }
>
> Not sure how all these accessors are better than making the enum public and
> exposing m_compositingDirtyBits via const accessor. They are not used that
> much.
I tried it the other way, but this way makes the code using the accessors more compact. Maybe grouping all the accessors together would make this header less noisy.
> > Source/WebCore/rendering/RenderLayer.h:261
> > + void setNeedsPostLayoutCompositingUpdate()
> > + {
> > + m_compositingDirtyBits.add(NeedsPostLayoutCompositingUpdate);
> > + setAncestorsHaveCompositingDirtyFlag(HasDescendantNeedingCompositingRequirementsTraversal);
> > + }
>
> Do all these really need to be in the header? It is already big.
I shrunk things down a bit.
> > Source/WebCore/rendering/RenderLayerBacking.cpp:629
> > } else
> > m_artificiallyInflatedBounds = false;
> >
> > - setCompositedBounds(layerBounds);
> > + return setCompositedBounds(layerBounds);
>
> Could m_artificiallyInflatedBounds change even when the computed bounds stay
> the same? Should we return true in that case?
I think it's OK; all that matters whether the composited bounds changed (whether or not they were inflated).
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:227
> > + , fullPaintOrderTraversalRequired(false)
> > + , descendantsRequireCompositingUpdate(false)
> > , ancestorHasTransformAnimation(false)
>
> These could be switched to modern initialization.
Done
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:691
> > + // Scrolling can affect overlap. FIXME: avoid for page scrolling.
> > + updateRoot->setDescendantsNeedCompositingRequirementsTraversal();
>
> Sounds like a big FIXME!
Yeah, filed bug 191546 to track.
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:697
> > + if (!updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() && !m_compositing) {
> > + LOG_WITH_STREAM(Compositing, stream << " no compositing work to do");
> > return false;
> > + }
>
> Why is this case considered 'unsuccessful'...
Fixed.
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:802
> > + compositingState.fullPaintOrderTraversalRequired |= layer.needsCompositingRequirementsTraversal();
> > + compositingState.descendantsRequireCompositingUpdate |= layer.descendantsNeedCompositingRequirementsTraversal();
>
> Using bit operators like this is slightly ugly.
Is there a nicer way?
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:1019
> > +// We have to traverse unchanged layers to fill in the overlap map.
> > +void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
>
> Can results of this traversal be cached? Presumably the results don't change
> if the layers are unchanged.
We'd have to keep the overlap map around, and then know how to dirty it.
>
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:1252
> > +void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer& layer)
> > +{
> > + // Inform the inspector that the given RenderLayer was destroyed.
> > + InspectorInstrumentation::renderLayerDestroyed(&page(), layer);
>
> Something here seems like a lie. Was the layer destroyed or did it just
> become non-composited?
Agreed. Filed bug 191547.
> > Source/WebCore/rendering/RenderLayerCompositor.h:142
> > + struct CompositingQueryData {
>
> This seems to introduce concept of "compositing query" but there are no
> functions or anything else referencing this concept, so it is bit difficult
> to understand how it is used.
Yeah. The "query" is the "do you need to composite" question. This struct really just wraps up a bunch of in and out params to these functions. I'll rename this to RequiresCompositingData.
> > Source/WebCore/rendering/RenderLayerCompositor.h:144
> > + RenderLayer::ViewportConstrainedNotCompositedReason nonCompositedForPositionReason { RenderLayer::NoNotCompositedReason };
>
> NoNotCompositedReason :(
Not new :|
> > Source/WebCore/rendering/RenderLayerCompositor.h:351
> > + bool needsToBeComposited(const RenderLayer&, CompositingQueryData&) const;
> > // Whether the layer has an intrinsic need for compositing layer.
> > - bool requiresCompositingLayer(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
> > + bool requiresCompositingLayer(const RenderLayer&, CompositingQueryData&) const;
>
> It is bit unclear if CompositingQueryData is an input, output or both for
> number of functions that take it. Could it be a (perhaps optional) return
> value when it is a pure output? Many clients initialize it in stack and
> invoke some function without doing anything between.
It has both inputs and outputs.
> > Source/WebCore/rendering/RenderLayerCompositor.h:379
> > + enum class UpdateLevel {
> > + AllDescendants = 1 << 0,
> > + CompositedChildren = 1 << 1,
> > + };
> > // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
> > - void rebuildCompositingLayerTree(RenderLayer&, Vector<Ref<GraphicsLayer>>& childGraphicsLayersOfEnclosingLayer, int depth);
> > + void updateBackingAndHierarchy(RenderLayer&, Vector<Ref<GraphicsLayer>>& childGraphicsLayersOfEnclosingLayer, OptionSet<UpdateLevel> = { }, int depth = 0);
>
> Why OptionSet? Doesn't 'AllDescendants' also cover 'CompositedChildren'? The
> logic might read better with a regular 3-value enum.
AllDescendants trumps CompositedChildren, yes. With a 3-state, there would be more if-then code when toggling CompositedChildren.
(In reply to Antti Koivisto from comment #98)
> Comment on attachment 354508[details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=354508&action=review
>
> > Source/WebCore/rendering/RenderLayer.cpp:690
> > + if (hasNegativeZOrderList != m_hadNegativeZOrderList) {
> > + m_hadNegativeZOrderList = hasNegativeZOrderList;
>
> The bit seems the reflect the current state so maybe m_has instead of m_had?
It's "had" in the sense that last time we updated z-order lists, we saw negative z children, but after lists are dirtied (which clears them), we are in a limbo state.
> > Source/WebCore/rendering/RenderLayer.h:1180
> > + OptionSet<CompositingStateFlag> m_compositingDirtyBits;
>
> Are these "state flags" or "dirty bits"? It would be nice if the type name
> and the field name matched.
It's OptionSet<Compositing> m_compositingDirtyBits now. "state" implies information about the steady state of the layer; these are dirty bits.
> > Using bit operators like this is slightly ugly.
>
> Is there a nicer way?
Both if() and operator|| avoid unnecessary evaluation of the right side (though it doesn't matter in practice here).
This breaks release builds with logging enabled. I've noticed a few times now that there's some confusion about when to use if !LOG_DISABLED, ifndef NDEBUG and now in this patch if ENABLE(TREE_DEBUGGING). We need a bot building release with logging enabled to catch these imo, I know I'm not the only one building like this, because full debug builds are too slow on my hardware :). Could someone have a look at 191583 where I've applied some build fixes for release+logging
2012-06-30 16:28 PDT, Simon Fraser (smfr)
2018-10-15 15:20 PDT, Simon Fraser (smfr)
2018-10-15 16:23 PDT, EWS Watchlist
2018-10-15 16:42 PDT, EWS Watchlist
2018-10-15 17:14 PDT, EWS Watchlist
2018-10-15 17:43 PDT, EWS Watchlist
2018-10-15 18:39 PDT, Simon Fraser (smfr)
2018-10-15 19:27 PDT, EWS Watchlist
2018-10-15 19:58 PDT, EWS Watchlist
2018-10-15 20:39 PDT, EWS Watchlist
2018-10-15 20:40 PDT, EWS Watchlist
2018-10-15 22:42 PDT, EWS Watchlist
2018-10-15 22:53 PDT, Simon Fraser (smfr)
2018-10-15 23:58 PDT, EWS Watchlist
2018-10-16 00:10 PDT, EWS Watchlist
2018-10-16 00:52 PDT, EWS Watchlist
2018-10-16 00:53 PDT, EWS Watchlist
2018-10-16 11:26 PDT, Simon Fraser (smfr)
2018-10-16 12:25 PDT, EWS Watchlist
2018-10-16 14:05 PDT, EWS Watchlist
2018-10-16 14:39 PDT, EWS Watchlist
2018-10-16 18:10 PDT, Simon Fraser (smfr)
2018-10-17 09:24 PDT, Simon Fraser (smfr)
2018-10-17 10:26 PDT, EWS Watchlist
2018-10-17 10:37 PDT, EWS Watchlist
2018-10-17 11:23 PDT, EWS Watchlist
2018-10-17 17:32 PDT, EWS Watchlist
2018-10-18 11:35 PDT, Simon Fraser (smfr)
2018-10-18 12:38 PDT, EWS Watchlist
2018-10-18 12:49 PDT, EWS Watchlist
2018-10-18 13:28 PDT, EWS Watchlist
2018-10-18 13:34 PDT, EWS Watchlist
2018-10-21 05:28 PDT, Simon Fraser (smfr)
2018-10-21 06:01 PDT, Simon Fraser (smfr)
2018-10-21 07:14 PDT, EWS Watchlist
2018-10-21 08:01 PDT, EWS Watchlist
2018-11-01 00:20 PDT, Simon Fraser (smfr)
2018-11-01 01:34 PDT, EWS Watchlist
2018-11-01 01:40 PDT, EWS Watchlist
2018-11-07 07:06 PST, Simon Fraser (smfr)
2018-11-07 10:22 PST, EWS Watchlist
2018-11-07 10:27 PST, EWS Watchlist
2018-11-09 14:59 PST, Simon Fraser (smfr)
2018-11-09 15:44 PST, Simon Fraser (smfr)
2018-11-09 15:52 PST, Simon Fraser (smfr)
2018-11-09 16:17 PST, Simon Fraser (smfr)
2018-11-09 17:43 PST, EWS Watchlist
2018-11-10 08:05 PST, Simon Fraser (smfr)
2018-11-10 14:03 PST, Simon Fraser (smfr)
2018-11-10 18:47 PST, Simon Fraser (smfr)
2018-11-11 11:19 PST, Simon Fraser (smfr)
ews-watchlist: commit-queue-
2018-11-11 13:05 PST, EWS Watchlist