Closed Bug 1465118 Opened 7 years ago Closed 7 years ago

Some small nsDisplayTransform improvements

Categories

(Core :: Web Painting, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: mikokm, Assigned: mikokm)

Details

Attachments

(4 files)

These patches disable/remove dead code, and cache the inverted transform matrix, since retained DL allows us to do that.
Comment on attachment 8981496 [details] Bug 1465118 - Part 1: Disable broken nsDisplayTransform::IsUniform() logic to avoid unnecessary work https://reviewboard.mozilla.org/r/247612/#review253712 ::: layout/painting/nsDisplayList.cpp:9036 (Diff revision 1) > * works. > */ > Maybe<nscolor> > nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder) const > { > +#if 0 Can we just delete this code instead?
Comment on attachment 8981497 [details] Bug 1465118 - Part 2: Remove unused nsDisplayTransform contructor https://reviewboard.mozilla.org/r/247614/#review253714
Attachment #8981497 - Flags: review?(matt.woodrow) → review+
Comment on attachment 8981498 [details] Bug 1465118 - Part 3: Use Maybe<T> to cache transformation matrix https://reviewboard.mozilla.org/r/247616/#review253716
Attachment #8981498 - Flags: review?(matt.woodrow) → review+
Comment on attachment 8981499 [details] Bug 1465118 - Part 4: Cache inverted transformation matrix for nsDisplayTransform https://reviewboard.mozilla.org/r/247618/#review253718 ::: layout/painting/nsDisplayList.cpp:8511 (Diff revision 2) > +{ > + if (mInverseTransform) { > + return *mInverseTransform; > + } > + > + MOZ_ASSERT(!GetTransform().IsSingular()); How do we prevent this from being hit? CSS can specify an arbitrary 4x4 matrix, which can definitely be singular. Maybe that means we end up with an empty visible region and don't build the display item?
Attachment #8981499 - Flags: review?(matt.woodrow) → review+
(In reply to Matt Woodrow (:mattwoodrow) from comment #8) > Comment on attachment 8981496 [details] > Bug 1465118 - Part 1: Disable broken nsDisplayTransform::IsUniform() logic > to avoid unnecessary work > > https://reviewboard.mozilla.org/r/247612/#review253712 > > ::: layout/painting/nsDisplayList.cpp:9036 > (Diff revision 1) > > * works. > > */ > > Maybe<nscolor> > > nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder) const > > { > > +#if 0 > > Can we just delete this code instead? I was thinking of fixing this as part of the bug 1464923. Or do you think that it is not worth it? (In reply to Matt Woodrow (:mattwoodrow) from comment #11) > Comment on attachment 8981499 [details] > Bug 1465118 - Part 4: Cache inverted transformation matrix for > nsDisplayTransform > > https://reviewboard.mozilla.org/r/247618/#review253718 > > ::: layout/painting/nsDisplayList.cpp:8511 > (Diff revision 2) > > +{ > > + if (mInverseTransform) { > > + return *mInverseTransform; > > + } > > + > > + MOZ_ASSERT(!GetTransform().IsSingular()); > > How do we prevent this from being hit? > > CSS can specify an arbitrary 4x4 matrix, which can definitely be singular. > > Maybe that means we end up with an empty visible region and don't build the > display item? This same check is done at the only call site of this function, nsDisplayTransform::UntransformRect().
(In reply to Miko Mynttinen [:miko] from comment #12) > (In reply to Matt Woodrow (:mattwoodrow) from comment #8) > > Comment on attachment 8981496 [details] > > Bug 1465118 - Part 1: Disable broken nsDisplayTransform::IsUniform() logic > > to avoid unnecessary work > > > > https://reviewboard.mozilla.org/r/247612/#review253712 > > > > ::: layout/painting/nsDisplayList.cpp:9036 > > (Diff revision 1) > > > * works. > > > */ > > > Maybe<nscolor> > > > nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder) const > > > { > > > +#if 0 > > > > Can we just delete this code instead? > > I was thinking of fixing this as part of the bug 1464923. Or do you think > that it is not worth it? Without a use case where we can see that it matters, I certainly wouldn't bother.
(In reply to Matt Woodrow (:mattwoodrow) from comment #13) > (In reply to Miko Mynttinen [:miko] from comment #12) > > (In reply to Matt Woodrow (:mattwoodrow) from comment #8) > > > Comment on attachment 8981496 [details] > > > Bug 1465118 - Part 1: Disable broken nsDisplayTransform::IsUniform() logic > > > to avoid unnecessary work > > > > > > https://reviewboard.mozilla.org/r/247612/#review253712 > > > > > > ::: layout/painting/nsDisplayList.cpp:9036 > > > (Diff revision 1) > > > > * works. > > > > */ > > > > Maybe<nscolor> > > > > nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder) const > > > > { > > > > +#if 0 > > > > > > Can we just delete this code instead? > > > > I was thinking of fixing this as part of the bug 1464923. Or do you think > > that it is not worth it? > > Without a use case where we can see that it matters, I certainly wouldn't > bother. This code is now removed.
Comment on attachment 8981496 [details] Bug 1465118 - Part 1: Disable broken nsDisplayTransform::IsUniform() logic to avoid unnecessary work https://reviewboard.mozilla.org/r/247612/#review254910
Attachment #8981496 - Flags: review?(matt.woodrow) → review+
Pushed by mikokm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2bb74a17a766 Part 1: Disable broken nsDisplayTransform::IsUniform() logic to avoid unnecessary work r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/6a9d2ad04ed2 Part 2: Remove unused nsDisplayTransform contructor r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/e6e9ebdf189f Part 3: Use Maybe<T> to cache transformation matrix r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/74cadc564216 Part 4: Cache inverted transformation matrix for nsDisplayTransform r=mattwoodrow
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: