Closed Bug 1210578 Opened 9 years ago Closed 9 years ago

refactor code that decides to build a scrollable layer and (potentially) create display ports

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

Details

Attachments

(3 files)

No description provided.
These patches apply after backing out the first three patches of bug 1195431.
This is more in line with it's actual meaning, and leads to code that makes more sense when reading it.
This also follows the meaning better.
We create DecideScrollableLayer. It determines if we will be building a scrollable layer (as well as returns the display port rect, if there is one). It also handles the "maybe create display port" part. For non-root scroll frames we just call it in ScrollFrameHelper::BuildDisplayList. For root scroll frames we are required to call it before we start building the display list for the root frame (not root _scroll frame) of the document.
Attachment #8668680 - Attachment description: Part 3. → Part 3. Create DecideScrollableLayer that encapsulates all logic to create display ports and build scrollable layers.
Attachment #8668675 - Flags: review?(mstange)
Attachment #8668676 - Flags: review?(mstange)
Attachment #8668680 - Flags: review?(mstange)
Attachment #8668675 - Flags: review?(mstange) → review+
Comment on attachment 8668676 [details] [diff] [review] Part 2. Rename shouldBuildLayer to couldBuildLayer. Review of attachment 8668676 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/nsGfxScrollFrame.cpp @@ +2915,5 @@ > // document. > // If the element is marked 'scrollgrab', also force building of a layer > // so that APZ can implement scroll grabbing. > mWillBuildScrollableLayer = usingDisplayPort || nsContentUtils::HasScrollgrab(mOuter->GetContent()); > + // whether we might want to build a scrollable layer for this scroll frame whether -> Whether @@ -3088,5 @@ > // a displayport for this frame. We'll add the item later on. > nsDisplayLayerEventRegions* inactiveRegionItem = nullptr; > if (aBuilder->IsPaintingToWindow() && > !mWillBuildScrollableLayer && > - shouldBuildLayer && heh
Attachment #8668676 - Flags: review?(mstange) → review+
Comment on attachment 8668680 [details] [diff] [review] Part 3. Create DecideScrollableLayer that encapsulates all logic to create display ports and build scrollable layers. Review of attachment 8668680 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/nsGfxScrollFrame.cpp @@ +3124,5 @@ > + } > + } > + } > + > + // Since making new layers is expensive, only use create a scrollable layer stray "use" ::: layout/generic/nsIScrollableFrame.h @@ +461,5 @@ > + * return the result. It will also record this result on the scroll frame. > + * Pass the dirty rect in aDirtyRect. On return it will be set to the > + * displayport if there is one (ie the dirty rect that should be used). > + * This function may create a display port where one did not exist before if > + * aAllowCreateDisplayPort is true. This also needs to mention that aAllowCreateDisplayPort is only allowed to be false if there has been a call with it set to true before.
Attachment #8668680 - Flags: review?(mstange) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: