зеркало из https://github.com/mozilla/gecko-dev.git
Bug 918288 - Add logging for some of the SetTargetAPZ codepaths. r=botond
This commit is contained in:
Родитель
0611166ee2
Коммит
3c73404215
|
@ -2448,6 +2448,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TABC_LOG("Got refresh, sending target APZCs for input block %" PRIu64 "\n", mInputBlockId);
|
||||||
mTabChild->SendSetTargetAPZC(mInputBlockId, mTargets);
|
mTabChild->SendSetTargetAPZC(mInputBlockId, mTargets);
|
||||||
|
|
||||||
if (!mPresShell->RemovePostRefreshObserver(this)) {
|
if (!mPresShell->RemovePostRefreshObserver(this)) {
|
||||||
|
@ -2494,21 +2495,34 @@ TabChild::SendSetTargetAPZCNotification(const WidgetTouchEvent& aEvent,
|
||||||
nsIScrollableFrame* scrollAncestor = GetScrollableAncestorFrame(target);
|
nsIScrollableFrame* scrollAncestor = GetScrollableAncestorFrame(target);
|
||||||
nsCOMPtr<dom::Element> dpElement = GetDisplayportElementFor(scrollAncestor);
|
nsCOMPtr<dom::Element> dpElement = GetDisplayportElementFor(scrollAncestor);
|
||||||
|
|
||||||
|
nsAutoString dpElementDesc;
|
||||||
|
if (dpElement) {
|
||||||
|
dpElement->Describe(dpElementDesc);
|
||||||
|
}
|
||||||
|
TABC_LOG("For input block %" PRIu64 " found scrollable element %p (%s)\n",
|
||||||
|
aInputBlockId, dpElement.get(),
|
||||||
|
NS_LossyConvertUTF16toASCII(dpElementDesc).get());
|
||||||
|
|
||||||
bool guidIsValid = APZCCallbackHelper::GetOrCreateScrollIdentifiers(
|
bool guidIsValid = APZCCallbackHelper::GetOrCreateScrollIdentifiers(
|
||||||
dpElement, &(guid.mPresShellId), &(guid.mScrollId));
|
dpElement, &(guid.mPresShellId), &(guid.mScrollId));
|
||||||
targets.AppendElement(guid);
|
targets.AppendElement(guid);
|
||||||
|
|
||||||
if (guidIsValid && !nsLayoutUtils::GetDisplayPort(dpElement, nullptr)) {
|
if (guidIsValid && !nsLayoutUtils::GetDisplayPort(dpElement, nullptr)) {
|
||||||
|
TABC_LOG("%p didn't have a displayport, so setting one...\n", dpElement.get());
|
||||||
waitForRefresh |= nsLayoutUtils::CalculateAndSetDisplayPortMargins(
|
waitForRefresh |= nsLayoutUtils::CalculateAndSetDisplayPortMargins(
|
||||||
scrollAncestor, nsLayoutUtils::RepaintMode::Repaint);
|
scrollAncestor, nsLayoutUtils::RepaintMode::Repaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (waitForRefresh) {
|
if (waitForRefresh) {
|
||||||
|
TABC_LOG("At least one target got a new displayport, need to wait for refresh\n");
|
||||||
waitForRefresh = shell->AddPostRefreshObserver(
|
waitForRefresh = shell->AddPostRefreshObserver(
|
||||||
new DisplayportSetListener(this, shell, aInputBlockId, targets));
|
new DisplayportSetListener(this, shell, aInputBlockId, targets));
|
||||||
}
|
}
|
||||||
if (!waitForRefresh) {
|
if (!waitForRefresh) {
|
||||||
|
TABC_LOG("Sending target APZCs for input block %" PRIu64 "\n", aInputBlockId);
|
||||||
SendSetTargetAPZC(aInputBlockId, targets);
|
SendSetTargetAPZC(aInputBlockId, targets);
|
||||||
|
} else {
|
||||||
|
TABC_LOG("Successfully registered post-refresh observer\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,16 @@ InputBlockState::SetConfirmedTargetApzc(const nsRefPtr<AsyncPanZoomController>&
|
||||||
}
|
}
|
||||||
mTargetConfirmed = true;
|
mTargetConfirmed = true;
|
||||||
|
|
||||||
|
if (mTargetApzc == aTargetApzc) {
|
||||||
|
// The confirmed target is the same as the tentative one, so we're done.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log enabled by default for now, we will put it in a TBS_LOG eventually
|
||||||
|
// once this code is more baked
|
||||||
|
printf_stderr("%p replacing unconfirmed target %p with real target %p\n",
|
||||||
|
this, mTargetApzc.get(), aTargetApzc.get());
|
||||||
|
|
||||||
// note that aTargetApzc MAY be null here.
|
// note that aTargetApzc MAY be null here.
|
||||||
mTargetApzc = aTargetApzc;
|
mTargetApzc = aTargetApzc;
|
||||||
mOverscrollHandoffChain = (mTargetApzc ? mTargetApzc->BuildOverscrollHandoffChain() : nullptr);
|
mOverscrollHandoffChain = (mTargetApzc ? mTargetApzc->BuildOverscrollHandoffChain() : nullptr);
|
||||||
|
|
|
@ -227,7 +227,8 @@ void
|
||||||
InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const nsRefPtr<AsyncPanZoomController>& aTargetApzc) {
|
InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const nsRefPtr<AsyncPanZoomController>& aTargetApzc) {
|
||||||
AsyncPanZoomController::AssertOnControllerThread();
|
AsyncPanZoomController::AssertOnControllerThread();
|
||||||
|
|
||||||
INPQ_LOG("got a target apzc; block=%" PRIu64 "\n", aInputBlockId);
|
INPQ_LOG("got a target apzc; block=%" PRIu64 " guid=%s\n",
|
||||||
|
aInputBlockId, aTargetApzc ? Stringify(aTargetApzc->GetGuid()).c_str() : "");
|
||||||
bool success = false;
|
bool success = false;
|
||||||
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
||||||
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче