Closed
Bug 1009020
Opened 11 years ago
Closed 11 years ago
Unnecessary invalidation during scrolling due to transform.NudgeToIntegers()
Categories
(Core :: Graphics: Layers, defect)
Core
Graphics: Layers
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(2 files)
|
768 bytes,
text/html
|
Details | |
|
5.65 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
STR:
1. Load the testcase and enable paint flashing.
2. Scroll a bit.
We unnecessarily invalidate the square.
| Assignee | ||
Comment 1•11 years ago
|
||
The transform in ChooseScaleAndSetTransform has a vertical translation that's -212.999756 minus the scroll position. NudgeToInteger in gfx/2d/Tools.h chooses the tolerance as (nudged value) * 1e-6. So the component gets nudged as soon as we've scrolled down 24px or more, because then the nudged value is <= -237, and
-237.0f - -237.0f * 1e-6f == -237.0f - -0.000237f == -236.999756f == -212.999756 - 24.0f
That means if we change the scroll position from 23px to 24px, our vertical translation component changes from -211.999756 to -213. For invalidation checking we first move the old value by the scroll offset in LayerPropertiesBase::MoveBy, which gives us -212.999756 for the old value, and then we compare that to the new value of -213. But mTransform.FuzzyEqual(transform) uses a fixed epsilon of 1e-4f, so the comparison fails and we invalidate.
I think we should make the NudgeToIntegers call in question use a fixed epsilon, just so that our nudging decision is independent from the scroll position.
Attachment #8421143 -
Flags: review?(roc)
Attachment #8421143 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Depends on: 1078262
You need to log in
before you can comment on or make changes to this bug.
Description
•