Bug 1109873 - Rename UpdatePanZoomControllerTree to UpdateHitTestingTree. r=botond

This commit is contained in:
Kartikaya Gupta 2015-01-08 09:40:01 -05:00
Родитель ea16e8f553
Коммит 1bf8a513d0
4 изменённых файлов: 51 добавлений и 51 удалений

Просмотреть файл

@ -153,11 +153,11 @@ Collect(HitTestingTreeNode* aNode, nsTArray<nsRefPtr<HitTestingTreeNode>>* aColl
}
void
APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
Layer* aRoot,
bool aIsFirstPaint,
uint64_t aOriginatingLayersId,
uint32_t aPaintSequenceNumber)
APZCTreeManager::UpdateHitTestingTree(CompositorParent* aCompositor,
Layer* aRoot,
bool aIsFirstPaint,
uint64_t aOriginatingLayersId,
uint32_t aPaintSequenceNumber)
{
if (AsyncPanZoomController::GetThreadAssertionsEnabled()) {
Compositor::AssertOnCompositorThread();
@ -196,10 +196,10 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
if (aRoot) {
mApzcTreeLog << "[start]\n";
LayerMetricsWrapper root(aRoot);
UpdatePanZoomControllerTree(state, root,
// aCompositor is null in gtest scenarios
aCompositor ? aCompositor->RootLayerTreeId() : 0,
Matrix4x4(), nullptr, nullptr, nsIntRegion());
UpdateHitTestingTree(state, root,
// aCompositor is null in gtest scenarios
aCompositor ? aCompositor->RootLayerTreeId() : 0,
Matrix4x4(), nullptr, nullptr, nsIntRegion());
mApzcTreeLog << "[end]\n";
}
MOZ_ASSERT(state.mEventRegions.Length() == 0);
@ -463,13 +463,13 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
}
HitTestingTreeNode*
APZCTreeManager::UpdatePanZoomControllerTree(TreeBuildingState& aState,
const LayerMetricsWrapper& aLayer,
uint64_t aLayersId,
const gfx::Matrix4x4& aAncestorTransform,
HitTestingTreeNode* aParent,
HitTestingTreeNode* aNextSibling,
const nsIntRegion& aObscured)
APZCTreeManager::UpdateHitTestingTree(TreeBuildingState& aState,
const LayerMetricsWrapper& aLayer,
uint64_t aLayersId,
const gfx::Matrix4x4& aAncestorTransform,
HitTestingTreeNode* aParent,
HitTestingTreeNode* aNextSibling,
const nsIntRegion& aObscured)
{
mTreeLock.AssertCurrentThreadOwns();
@ -544,9 +544,9 @@ APZCTreeManager::UpdatePanZoomControllerTree(TreeBuildingState& aState,
obscured.Transform(To3DMatrix(transform).Inverse());
for (LayerMetricsWrapper child = aLayer.GetLastChild(); child; child = child.GetPrevSibling()) {
gfx::TreeAutoIndent indent(mApzcTreeLog);
next = UpdatePanZoomControllerTree(aState, child, childLayersId,
ancestorTransform, aParent, next,
obscured);
next = UpdateHitTestingTree(aState, child, childLayersId,
ancestorTransform, aParent, next,
obscured);
// Each layer obscures its previous siblings, so we augment the obscured
// region as we loop backwards through the children.

Просмотреть файл

@ -74,7 +74,7 @@ class HitTestingTreeNode;
* This class generally lives on the compositor thread, although some functions
* may be called from other threads as noted; thread safety is ensured internally.
*
* The bulk of the work of this class happens as part of the UpdatePanZoomControllerTree
* The bulk of the work of this class happens as part of the UpdateHitTestingTree
* function, which is when a layer tree update is received by the compositor.
* This function walks through the layer tree and creates a tree of APZC instances
* to match the scrollable container layers. APZC instances may be preserved across
@ -99,7 +99,7 @@ class APZCTreeManager {
// Helper struct to hold some state while we build the APZ tree. The
// sole purpose of this struct is to shorten the argument list to
// UpdatePanZoomControllerTree. All the state that we don't need to
// UpdateHitTestingTree. All the state that we don't need to
// push on the stack during recursion and pop on unwind is stored here.
struct TreeBuildingState;
@ -127,11 +127,11 @@ public:
* process' layer subtree has its own sequence
* numbers.
*/
void UpdatePanZoomControllerTree(CompositorParent* aCompositor,
Layer* aRoot,
bool aIsFirstPaint,
uint64_t aOriginatingLayersId,
uint32_t aPaintSequenceNumber);
void UpdateHitTestingTree(CompositorParent* aCompositor,
Layer* aRoot,
bool aIsFirstPaint,
uint64_t aOriginatingLayersId,
uint32_t aPaintSequenceNumber);
/**
* General handler for incoming input events. Manipulates the frame metrics
@ -477,13 +477,13 @@ private:
* aNextSibling if no APZCs were built for the
* layer subtree at this level.
*/
HitTestingTreeNode* UpdatePanZoomControllerTree(TreeBuildingState& aState,
const LayerMetricsWrapper& aLayer,
uint64_t aLayersId,
const gfx::Matrix4x4& aAncestorTransform,
HitTestingTreeNode* aParent,
HitTestingTreeNode* aNextSibling,
const nsIntRegion& aObscured);
HitTestingTreeNode* UpdateHitTestingTree(TreeBuildingState& aState,
const LayerMetricsWrapper& aLayer,
uint64_t aLayersId,
const gfx::Matrix4x4& aAncestorTransform,
HitTestingTreeNode* aParent,
HitTestingTreeNode* aNextSibling,
const nsIntRegion& aObscured);
void PrintAPZCInfo(const LayerMetricsWrapper& aLayer,
const AsyncPanZoomController* apzc);

Просмотреть файл

@ -733,7 +733,7 @@ CompositorParent::NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint,
mLayerManager &&
mLayerManager->GetRoot()) {
AutoResolveRefLayers resolve(mCompositionManager);
mApzcTreeManager->UpdatePanZoomControllerTree(this, mLayerManager->GetRoot(),
mApzcTreeManager->UpdateHitTestingTree(this, mLayerManager->GetRoot(),
aIsFirstPaint, aId, aPaintSequenceNumber);
mLayerManager->NotifyShadowTreeTransaction();
@ -1006,7 +1006,7 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
if (mApzcTreeManager && !aIsRepeatTransaction) {
AutoResolveRefLayers resolve(mCompositionManager);
mApzcTreeManager->UpdatePanZoomControllerTree(this, root, aIsFirstPaint,
mApzcTreeManager->UpdateHitTestingTree(this, root, aIsFirstPaint,
mRootLayerTreeID, aPaintSequenceNumber);
}

Просмотреть файл

@ -1835,7 +1835,7 @@ TEST_F(APZHitTestingTester, HitTesting1) {
// Now we have a root APZC that will match the page
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, paintSequenceNumber++);
manager->UpdateHitTestingTree(nullptr, root, false, 0, paintSequenceNumber++);
hit = GetTargetAPZC(ScreenPoint(15, 15));
EXPECT_EQ(ApzcOf(root), hit.get());
// expect hit point at LayerIntPoint(15, 15)
@ -1844,7 +1844,7 @@ TEST_F(APZHitTestingTester, HitTesting1) {
// Now we have a sub APZC with a better fit
SetScrollableFrameMetrics(layers[3], FrameMetrics::START_SCROLL_ID + 1);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, paintSequenceNumber++);
manager->UpdateHitTestingTree(nullptr, root, false, 0, paintSequenceNumber++);
EXPECT_NE(ApzcOf(root), ApzcOf(layers[3]));
hit = GetTargetAPZC(ScreenPoint(25, 25));
EXPECT_EQ(ApzcOf(layers[3]), hit.get());
@ -1859,7 +1859,7 @@ TEST_F(APZHitTestingTester, HitTesting1) {
// Now test hit testing when we have two scrollable layers
SetScrollableFrameMetrics(layers[4], FrameMetrics::START_SCROLL_ID + 2);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, paintSequenceNumber++);
manager->UpdateHitTestingTree(nullptr, root, false, 0, paintSequenceNumber++);
hit = GetTargetAPZC(ScreenPoint(15, 15));
EXPECT_EQ(ApzcOf(layers[4]), hit.get());
// expect hit point at LayerIntPoint(15, 15)
@ -1889,7 +1889,7 @@ TEST_F(APZHitTestingTester, HitTesting2) {
CreateHitTesting2LayerTree();
ScopedLayerTreeRegistration registration(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
// At this point, the following holds (all coordinates in screen pixels):
// layers[0] has content from (0,0)-(200,200), clipped by composition bounds (0,0)-(100,100)
@ -2005,7 +2005,7 @@ TEST_F(APZCTreeManagerTester, ScrollablePaintedLayers) {
// both layers have the same scrollId
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID);
SetScrollableFrameMetrics(layers[2], FrameMetrics::START_SCROLL_ID);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
TestAsyncPanZoomController* nullAPZC = nullptr;
// so they should have the same APZC
@ -2016,13 +2016,13 @@ TEST_F(APZCTreeManagerTester, ScrollablePaintedLayers) {
// Change the scrollId of layers[1], and verify the APZC changes
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID + 1);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
EXPECT_NE(ApzcOf(layers[1]), ApzcOf(layers[2]));
// Change the scrollId of layers[2] to match that of layers[1], ensure we get the same
// APZC for both again
SetScrollableFrameMetrics(layers[2], FrameMetrics::START_SCROLL_ID + 1);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
EXPECT_EQ(ApzcOf(layers[1]), ApzcOf(layers[2]));
}
@ -2030,7 +2030,7 @@ TEST_F(APZCTreeManagerTester, Bug1068268) {
CreatePotentiallyLeakingTree();
ScopedLayerTreeRegistration registration(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
nsRefPtr<HitTestingTreeNode> root = manager->GetRootNode();
nsRefPtr<HitTestingTreeNode> node2 = root->GetFirstChild();
nsRefPtr<HitTestingTreeNode> node5 = root->GetLastChild();
@ -2051,7 +2051,7 @@ TEST_F(APZCTreeManagerTester, Bug1068268) {
TEST_F(APZHitTestingTester, ComplexMultiLayerTree) {
CreateComplexMultiLayerTree();
ScopedLayerTreeRegistration registration(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
TestAsyncPanZoomController* nullAPZC = nullptr;
// Ensure all the scrollable layers have an APZC
@ -2117,7 +2117,7 @@ TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
CreateSimpleScrollingLayer();
ScopedLayerTreeRegistration registration(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
TestAsyncPanZoomController* apzcroot = ApzcOf(root);
// At this point, the following holds (all coordinates in screen pixels):
@ -2195,7 +2195,7 @@ protected:
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID + 1, CSSRect(0, 0, 100, 100));
SetScrollHandoff(layers[1], root);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
}
@ -2215,7 +2215,7 @@ protected:
// No ScopedLayerTreeRegistration as that just needs to be done once per test
// and this is the second layer tree for a particular test.
MOZ_ASSERT(registration);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
}
@ -2236,7 +2236,7 @@ protected:
SetScrollHandoff(layers[2], layers[1]);
SetScrollHandoff(layers[4], layers[3]);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
}
void CreateScrollgrabLayerTree() {
@ -2250,7 +2250,7 @@ protected:
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID + 1, CSSRect(0, 0, 100, 200));
SetScrollHandoff(layers[1], root);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
rootApzc->GetFrameMetrics().SetHasScrollgrab(true);
}
@ -2471,7 +2471,7 @@ protected:
layers[2]->SetEventRegions(regions);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
}
@ -2492,7 +2492,7 @@ protected:
layers[1]->SetEventRegions(regions);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdatePanZoomControllerTree(nullptr, root, false, 0, 0);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
}
};