зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1600652 - Update Scroll frame metrics for android so text select popup is in correct location. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D58165 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e98ae699f5
Коммит
e673d8a673
|
@ -731,6 +731,16 @@ void APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
|
|||
wr::ToLayoutPoint(asyncScrollDelta));
|
||||
|
||||
apzc->ReportCheckerboard(aSampleTime);
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
// Send the root frame metrics to java through the UIController
|
||||
RefPtr<UiCompositorControllerParent> uiController =
|
||||
UiCompositorControllerParent::GetFromRootLayerTreeId(mRootLayersId);
|
||||
if (uiController &&
|
||||
apzc->UpdateRootFrameMetricsIfChanged(mLastRootMetrics)) {
|
||||
uiController->NotifyUpdateScreenMetrics(mLastRootMetrics);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Now collect all the async transforms needed for the scrollthumbs.
|
||||
|
|
|
@ -954,6 +954,9 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
|
|||
|
||||
private:
|
||||
RefPtr<AndroidDynamicToolbarAnimator> mToolbarAnimator;
|
||||
|
||||
// Last Frame metrics sent to java through UIController.
|
||||
FrameMetrics mLastRootMetrics;
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
};
|
||||
|
||||
|
|
|
@ -4800,6 +4800,24 @@ const FrameMetrics& AsyncPanZoomController::Metrics() const {
|
|||
;
|
||||
}
|
||||
|
||||
bool AsyncPanZoomController::UpdateRootFrameMetricsIfChanged(
|
||||
FrameMetrics& metrics) {
|
||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||
|
||||
const FrameMetrics& aMetrics = Metrics();
|
||||
if (!aMetrics.IsRootContent()) return false;
|
||||
|
||||
bool hasChanged = RoundedToInt(metrics.GetScrollOffset()) !=
|
||||
RoundedToInt(aMetrics.GetScrollOffset()) ||
|
||||
metrics.GetZoom() != aMetrics.GetZoom();
|
||||
|
||||
if (hasChanged) {
|
||||
metrics = aMetrics;
|
||||
}
|
||||
|
||||
return hasChanged;
|
||||
}
|
||||
|
||||
const FrameMetrics& AsyncPanZoomController::GetFrameMetrics() const {
|
||||
return Metrics();
|
||||
}
|
||||
|
|
|
@ -554,6 +554,10 @@ class AsyncPanZoomController {
|
|||
const FrameMetrics& Metrics() const;
|
||||
FrameMetrics& Metrics();
|
||||
|
||||
// Helper function to compare root frame metrics and update them
|
||||
// Returns true when the metrics have changed and were updated.
|
||||
bool UpdateRootFrameMetricsIfChanged(FrameMetrics& metrics);
|
||||
|
||||
private:
|
||||
// Get whether the horizontal content of the honoured target of auto-dir
|
||||
// scrolling starts from right to left. If you don't know of auto-dir
|
||||
|
|
Загрузка…
Ссылка в новой задаче