Bug 941138 - Move the code to update the cached transform. r=botond

This commit is contained in:
Kartikaya Gupta 2014-01-17 09:52:49 -05:00
parent ab79c85864
commit abb983b7c2

View File

@ -400,9 +400,6 @@ APZCTreeManager::GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent,
// Prepare for possible overscroll handoff.
BuildOverscrollHandoffChain(apzc);
}
gfx3DMatrix transformToApzc, transformToGecko;
// Reset the cached apz transform
mCachedTransformToApzcForInputBlock = transformToApzc;
if (!apzc) {
return apzc.forget();
}
@ -417,10 +414,6 @@ APZCTreeManager::GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent,
apzc = RootAPZCForLayersId(apzc);
APZC_LOG("Using APZC %p as the root APZC for multi-touch\n", apzc.get());
}
if (apzc) {
// Cache apz transform so it can be used for future events in this block.
GetInputTransforms(apzc, mCachedTransformToApzcForInputBlock, transformToGecko);
}
return apzc.forget();
}
@ -439,6 +432,14 @@ APZCTreeManager::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
mTouchCount++;
ScreenPoint point = ScreenPoint(aEvent.touches[0]->mRefPoint.x, aEvent.touches[0]->mRefPoint.y);
mApzcForInputBlock = GetTouchInputBlockAPZC(aEvent, point);
if (mApzcForInputBlock) {
// Cache apz transform so it can be used for future events in this block.
gfx3DMatrix transformToGecko;
GetInputTransforms(mApzcForInputBlock, mCachedTransformToApzcForInputBlock, transformToGecko);
} else {
// Reset the cached apz transform
mCachedTransformToApzcForInputBlock = gfx3DMatrix();
}
}
if (mApzcForInputBlock) {