Closed
Bug 1008301
Opened 11 years ago
Closed 11 years ago
Unnecessary invalidation during scrolling in this testcase due to changing visible region
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(7 files)
905 bytes,
text/html
|
Details | |
942 bytes,
text/html
|
Details | |
3.76 KB,
patch
|
Details | Diff | Splinter Review | |
1.10 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
4.47 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
1.33 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
2.08 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
In the testcase, there are two grey boxes. When the upper one scrolls out of the viewport, we invalidate the green box and a bit around it. That's because we change the visible region of the container layer in the basic layer manager of the inactive transform of the wrapper element, which contains the two grey boxes (but not the green one).
This visible region is created in FrameLayerBuilder::BuildContainerLayerFor using state.GetChildrenBounds() - it's a bounding box.
Assignee | ||
Comment 1•11 years ago
|
||
This testcase is very similar to the first one, except that it has another wrapping transform.
Assignee | ||
Comment 2•11 years ago
|
||
These kinds of constructs, i.e. many nested inactive transform layers, are extremely common in SVGs. Scrolling over SVGs currently causes lots of unnecessary invalidations, and this bug is one of the causes.
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8420230 -
Attachment description: invalidat reftest → invalidation reftest
Assignee | ||
Comment 4•11 years ago
|
||
I'd like to just kill this invalidation. All causes of visible region changes I could think of will either invalidate their frame manually or are handled by the other checks in LayerTreeInvalidation.cpp. The tryserver found one case where this patch causes us to miss something that needs to be invalidated, and I'm fixing that in the next patch.
Attachment #8420234 -
Flags: review?(roc)
Assignee | ||
Comment 5•11 years ago
|
||
The only failure with the preceding patch was in http://dxr.mozilla.org/mozilla-central/source/layout/reftests/bugs/978911-1.svg .
That testcase changes the transform of a basic container layer, but the container layer's prescale changes to match so that the layer still has 1:1 layer pixels to screen pixels, so Layer::GetTransform() multiplies that prescale into the transform it returns, so LayerPropertiesBase::ComputeChange doesn't see a transform change and doesn't invalidate the new layer contents.
This patch treats changes of pre and post scale like transform changes and invalidates both the old and the new bounds.
Attachment #8420237 -
Flags: review?(roc)
Assignee | ||
Comment 6•11 years ago
|
||
The 978911-1.svg reftest was getting partially invalidated even without the "part 2" patch, but only the pre-transform-change bounds were invalidated. And that invalidation only printed "invalidating entire layer etc." without giving the reason. This adds the reason logging.
Attachment #8420243 -
Flags: review?(roc)
Assignee | ||
Comment 7•11 years ago
|
||
Part 1 is not enough to stop the invalidation on the testcases in this bug; there's another invalidation coming from the changes in clip. The current code there doesn't make much sense to me, but I'm not sure that this change makes more sense... does this look correct?
It stops the invalidation and passes reftests, at least.
Attachment #8420244 -
Flags: review?(roc)
Attachment #8420234 -
Flags: review?(roc) → review+
Attachment #8420237 -
Flags: review?(roc) → review+
Attachment #8420243 -
Flags: review?(roc) → review+
Comment on attachment 8420244 [details] [diff] [review]
part 4: Make clipping changes invalidate less
Review of attachment 8420244 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/DisplayItemClip.cpp
@@ +275,5 @@
> mRoundedClipRects.Clear();
> }
>
> static void
> +AccumulateRectDifference(const nsRect& aR1, const nsRect& aR2, const nsRect& aClip, nsRegion* aOut)
Don't call this "aClip" since the caller is working with cliprects and aClip is not a clip rect there. Call this aBounds and document that this computes the difference between aR1 and aR2 and then limits that to aBounds.
@@ +300,5 @@
> return;
> }
> if (mHaveClipRect) {
> + AccumulateRectDifference(mClipRect + aOffset, aOther.mClipRect,
> + aBounds.Union(aOtherBounds),
It's certainly easier to understand that this is correct.
Attachment #8420244 -
Flags: review?(roc) → review+
Assignee | ||
Comment 10•11 years ago
|
||
I backed this out in https://hg.mozilla.org/integration/mozilla-inbound/rev/62b1d56d91e5 (alongside bug 1008578) for causing OSX 10.8 reftest failures:
https://tbpl.mozilla.org/php/getParsedLog.php?id=39511663&tree=Mozilla-Inbound
Flags: needinfo?(mstange)
Assignee | ||
Comment 12•11 years ago
|
||
Bug 1008578 was responsible. Relanded:
https://hg.mozilla.org/integration/mozilla-inbound/rev/30b083624741
https://hg.mozilla.org/integration/mozilla-inbound/rev/237e5755e750
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c9aa8bf1dc9
https://hg.mozilla.org/integration/mozilla-inbound/rev/de4fccc2e2fa
Flags: needinfo?(mstange)
Comment 13•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/30b083624741
https://hg.mozilla.org/mozilla-central/rev/237e5755e750
https://hg.mozilla.org/mozilla-central/rev/2c9aa8bf1dc9
https://hg.mozilla.org/mozilla-central/rev/de4fccc2e2fa
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Updated•10 years ago
|
Assignee | ||
Comment 14•10 years ago
|
||
Backed out from Aurora: https://hg.mozilla.org/releases/mozilla-aurora/rev/0fcb1dc73d58
Target Milestone: mozilla32 → mozilla33
Comment 15•10 years ago
|
||
Target milestone tracks trunk landing, which hasn't changed. Setting things accordingly.
status-firefox32:
--- → disabled
status-firefox33:
--- → fixed
Target Milestone: mozilla33 → mozilla32
Assignee | ||
Comment 16•10 years ago
|
||
Backed out from Aurora again: https://hg.mozilla.org/releases/mozilla-aurora/rev/8c0e169eb2b9
status-firefox34:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•