Closed
Bug 1222880
Opened 9 years ago
Closed 9 years ago
Build a tree of AnimatedGeometryRoot objects to optimize finding ancestors
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: mattwoodrow, Assigned: mattwoodrow)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
99.71 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
FLB frequently walks up AnimatedGeometryRoots (usually looking for scrollable frames), and this adds up to a fair amount of time in some profiles. We already basically have this information during display list building as AutoBuildingDisplayList stores each AnimatedGeometryRoot on the stack. I want to copy this into the display list arena so that FLB can use it.
Assignee | ||
Comment 1•9 years ago
|
||
I also want to get rid of the nsLayoutUtils functions for finding AGRs, and require that you obtain them from a display item instead. We had confusion previously where the AGR for a frame wasn't always defined (transforms, background-attachment:fixed etc), and this should fix that.
Assignee | ||
Comment 2•9 years ago
|
||
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8684765 -
Attachment is obsolete: true
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8685811 -
Attachment is obsolete: true
Attachment #8685935 -
Flags: review?(roc)
Assignee | ||
Updated•9 years ago
|
Attachment #8685935 -
Flags: review?(tnikkel)
Comment on attachment 8685935 [details] [diff] [review] Keep a tree of AGRs for faster traversal Review of attachment 8685935 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsDisplayList.cpp @@ +669,5 @@ > getter_AddRefs(mBoundingSelection)); > } > } > > + mAnimatedGeometryRootCache.Put(aReferenceFrame, &mRootAGR); Call this mFrameToAnimatedGeometryRootMap to indicate it's not a cache. ::: layout/base/nsDisplayList.h @@ +107,5 @@ > virtual const char* Name() override { return n; } \ > virtual Type GetType() override { return e; } > > + > +struct AnimatedGeometryRoot Needs documentation @@ +1122,5 @@ > > uint32_t mBudget; > }; > > + nsIFrame* const mReferenceFrame; fix indent, or just stop aligning all these fields
Attachment #8685935 -
Flags: review?(roc) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8685935 [details] [diff] [review] Keep a tree of AGRs for faster traversal Since you are removing the only user of nsDisplayTransform::IsReferenceFrameBoundary can you remove that function too? So this effectively removes the frame->AGR cache, and replaces it with an frameAGR->AGR struct cache. Why not just make it a frame->AGR struct cache? >+nsDisplayListBuilder::WrapAGRForFrame(nsIFrame* aAnimatedGeometryRoot, >+ nsIFrame* parentFrame = nsLayoutUtils::GetCrossDocParentFrame(aAnimatedGeometryRoot); Can you add an assert that this doesn't go above the root reference frame? > nsDisplayListBuilder::RecomputeCurrentAnimatedGeometryRoot() > { >+ if (*mCurrentAGR != mCurrentFrame && >+ IsAnimatedGeometryRoot(const_cast<nsIFrame*>(mCurrentFrame))) { >+ mCurrentAGR = WrapAGRForFrame(const_cast<nsIFrame*>(mCurrentFrame), mCurrentAGR); >+ } > } This technically isn't enough since any child AGR struct of mCurrentFrame will point to mCurrentAGR when it should point to mCurrentFrame. It's gross, but should we iterate the hash table of AGR structs and update their fields? >+struct AnimatedGeometryRoot >+ AnimatedGeometryRoot* mParent; Can we call this mParentAGR? Otherwise it's too easy to get confused between the AGR parent and the frame parent.
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8685935 -
Attachment is obsolete: true
Attachment #8685935 -
Flags: review?(tnikkel)
Attachment #8691270 -
Flags: review?(tnikkel)
Comment 8•9 years ago
|
||
Comment on attachment 8691270 [details] [diff] [review] Keep a tree of AGRs for faster traversal v2 Thanks. We'll have to keep on eye on RecomputeCurrentAnimatedGeometryRoot because if we force activate a scrollframe that is deeply nested inside other scrollframes we'll have to force activate them all, and call RecomputeCurrentAnimatedGeometryRoot for them all. But that should be rare (because we set a displayport on all ancestors when setting a displayport on a child, and it should only last one paint because we set a displayport when we force layerize.
Attachment #8691270 -
Flags: review?(tnikkel) → review+
Comment 12•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/78381aa444d4 https://hg.mozilla.org/mozilla-central/rev/dd4e51f9f4aa https://hg.mozilla.org/mozilla-central/rev/5e8bd912ef98
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•