mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 918288 - Add logging for some of the SetTargetAPZ codepaths. r=botond
This commit is contained in:
parent
0611166ee2
commit
3c73404215
@ -2448,6 +2448,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
TABC_LOG("Got refresh, sending target APZCs for input block %" PRIu64 "\n", mInputBlockId);
|
||||
mTabChild->SendSetTargetAPZC(mInputBlockId, mTargets);
|
||||
|
||||
if (!mPresShell->RemovePostRefreshObserver(this)) {
|
||||
@ -2494,21 +2495,34 @@ TabChild::SendSetTargetAPZCNotification(const WidgetTouchEvent& aEvent,
|
||||
nsIScrollableFrame* scrollAncestor = GetScrollableAncestorFrame(target);
|
||||
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(
|
||||
dpElement, &(guid.mPresShellId), &(guid.mScrollId));
|
||||
targets.AppendElement(guid);
|
||||
|
||||
if (guidIsValid && !nsLayoutUtils::GetDisplayPort(dpElement, nullptr)) {
|
||||
TABC_LOG("%p didn't have a displayport, so setting one...\n", dpElement.get());
|
||||
waitForRefresh |= nsLayoutUtils::CalculateAndSetDisplayPortMargins(
|
||||
scrollAncestor, nsLayoutUtils::RepaintMode::Repaint);
|
||||
}
|
||||
}
|
||||
if (waitForRefresh) {
|
||||
TABC_LOG("At least one target got a new displayport, need to wait for refresh\n");
|
||||
waitForRefresh = shell->AddPostRefreshObserver(
|
||||
new DisplayportSetListener(this, shell, aInputBlockId, targets));
|
||||
}
|
||||
if (!waitForRefresh) {
|
||||
TABC_LOG("Sending target APZCs for input block %" PRIu64 "\n", aInputBlockId);
|
||||
SendSetTargetAPZC(aInputBlockId, targets);
|
||||
} else {
|
||||
TABC_LOG("Successfully registered post-refresh observer\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,16 @@ InputBlockState::SetConfirmedTargetApzc(const nsRefPtr<AsyncPanZoomController>&
|
||||
}
|
||||
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.
|
||||
mTargetApzc = aTargetApzc;
|
||||
mOverscrollHandoffChain = (mTargetApzc ? mTargetApzc->BuildOverscrollHandoffChain() : nullptr);
|
||||
|
@ -227,7 +227,8 @@ void
|
||||
InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const nsRefPtr<AsyncPanZoomController>& aTargetApzc) {
|
||||
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;
|
||||
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
||||
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user