RESOLVED FIXED 220915
Use ScrollSnapOffsetsInfo in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=220915
Summary Use ScrollSnapOffsetsInfo in the scrolling tree
Martin Robinson
Reported 2021-01-25 04:04:44 PST
This bugs track using ScrollSnapOffsetsInfo to abstract away details of the scroll snap offsets in the scrolling tree.
Attachments
Patch (45.11 KB, patch)
2021-01-25 04:16 PST, Martin Robinson
ews-feeder: commit-queue-
Patch (45.16 KB, patch)
2021-01-25 04:33 PST, Martin Robinson
ews-feeder: commit-queue-
Patch (45.35 KB, patch)
2021-01-25 04:46 PST, Martin Robinson
no flags
Patch (45.34 KB, patch)
2021-01-25 05:39 PST, Martin Robinson
ews-feeder: commit-queue-
Patch (45.36 KB, patch)
2021-01-25 07:25 PST, Martin Robinson
no flags
Patch (47.89 KB, patch)
2021-01-26 06:17 PST, Martin Robinson
no flags
Martin Robinson
Comment 1 2021-01-25 04:16:41 PST
Martin Robinson
Comment 2 2021-01-25 04:33:55 PST
Martin Robinson
Comment 3 2021-01-25 04:46:29 PST
Martin Robinson
Comment 4 2021-01-25 05:39:49 PST
Martin Robinson
Comment 5 2021-01-25 07:25:25 PST
Simon Fraser (smfr)
Comment 6 2021-01-25 10:10:06 PST
Comment on attachment 418290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418290&action=review > Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:118 > + auto convertOffsetsToFloats = [deviceScaleFactor](const Vector<LayoutUnit>& offsets, Vector<float>& floatOffsets) > + { > + floatOffsets.reserveInitialCapacity(offsets.size()); > + for (auto& offset : offsets) > + floatOffsets.uncheckedAppend(roundToDevicePixel(offset, deviceScaleFactor, false)); > + }; > + > + auto convertOffsetRangesToFloat = [deviceScaleFactor](const Vector<ScrollOffsetRange<LayoutUnit>>& offsetRanges, Vector<ScrollOffsetRange<float>>& floatOffsetRanges) > + { > + floatOffsetRanges.reserveInitialCapacity(offsetRanges.size()); > + for (auto& range : offsetRanges) > + floatOffsetRanges.uncheckedAppend({ roundToDevicePixel(range.start, deviceScaleFactor, false), roundToDevicePixel(range.end, deviceScaleFactor, false) }); > + }; > + > + convertOffsetsToFloats(offsetInfo->horizontalSnapOffsets, floatInfo.horizontalSnapOffsets); > + convertOffsetsToFloats(offsetInfo->verticalSnapOffsets, floatInfo.verticalSnapOffsets); > + convertOffsetRangesToFloat(offsetInfo->horizontalSnapOffsetRanges, floatInfo.horizontalSnapOffsetRanges); > + convertOffsetRangesToFloat(offsetInfo->verticalSnapOffsetRanges, floatInfo.verticalSnapOffsetRanges); All this conversion should be in some helpers on ScrollSnapOffsetsInfo. Can we do template specialization goop to just have it be a special operator=?
Martin Robinson
Comment 7 2021-01-26 06:17:10 PST
Martin Robinson
Comment 8 2021-01-26 06:18:23 PST
(In reply to Simon Fraser (smfr) from comment #6) > All this conversion should be in some helpers on ScrollSnapOffsetsInfo. Can > we do template specialization goop to just have it be a special operator=? Thanks for the review. I've moved all the conversion functions to ScrollSnapOffsetsInfo. I'm using a templated method, because we need to pass in an argument for the device scale when converting from LayoutUnits to floats. The method is called convertUnits.
Simon Fraser (smfr)
Comment 9 2021-01-26 10:13:52 PST
Comment on attachment 418411 [details] Patch Nice.
EWS
Comment 10 2021-01-27 00:41:48 PST
Committed r271937: <https://trac.webkit.org/changeset/271937> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418411 [details].
Radar WebKit Bug Importer
Comment 11 2021-01-27 00:42:17 PST
Note You need to log in before you can comment on or make changes to this bug.