Bug 1389146 - Enable WR hit-testing when the pref is enabled. r?mstange,botond
This drops the code that compares the WR and Gecko hit-test results when
WR is enabled, because the "baseline" Gecko hit-test result is not
correct enough to provide a useful comparison. Instead flipping the pref
now just enables the WR hit-test code; we will rely on automated testing
to check for correctness.
MozReview-Commit-ID: 8IFtk0p2NvE
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -2214,40 +2214,20 @@ APZCTreeManager::GetTargetAPZC(const Scr
CompositorHitTestInfo* aOutHitResult,
RefPtr<HitTestingTreeNode>* aOutScrollbarNode)
{
MutexAutoLock lock(mTreeLock);
CompositorHitTestInfo hitResult = CompositorHitTestInfo::eInvisibleToHitTest;
HitTestingTreeNode* scrollbarNode = nullptr;
RefPtr<AsyncPanZoomController> target;
- target = GetAPZCAtPoint(mRootNode, aPoint, &hitResult, &scrollbarNode);
-
if (gfxPrefs::WebRenderHitTest()) {
- CompositorHitTestInfo wrHitResult = CompositorHitTestInfo::eInvisibleToHitTest;
- HitTestingTreeNode* wrScrollbarNode = nullptr;
- RefPtr<AsyncPanZoomController> wrTarget = GetAPZCAtPointWR(aPoint, &wrHitResult, &wrScrollbarNode);
- // For now just compare the WR and non-WR results.
- if (wrHitResult != hitResult) {
- printf_stderr("WR hit result mismatch at %s: got 0x%x, expected 0x%x\n",
- Stringify(aPoint).c_str(), (int)wrHitResult, (int)hitResult);
- // MOZ_RELEASE_ASSERT(false);
- }
- if (wrTarget.get() != target.get()) {
- printf_stderr("WR hit target mismatch at %s: got %s, expected %s\n",
- Stringify(aPoint).c_str(),
- wrTarget ? Stringify(wrTarget->GetGuid()).c_str() : "null",
- target ? Stringify(target->GetGuid()).c_str() : "null");
- // MOZ_RELEASE_ASSERT(false);
- }
- if (wrScrollbarNode != scrollbarNode) {
- printf_stderr("WR scrollbar node mismatch at %s: got %p, expected %p\n",
- Stringify(aPoint).c_str(), wrScrollbarNode, scrollbarNode);
- // MOZ_RELEASE_ASSERT(false);
- }
+ target = GetAPZCAtPointWR(aPoint, &hitResult, &scrollbarNode);
+ } else {
+ target = GetAPZCAtPoint(mRootNode, aPoint, &hitResult, &scrollbarNode);
}
if (aOutHitResult) {
*aOutHitResult = hitResult;
}
if (aOutScrollbarNode) {
*aOutScrollbarNode = scrollbarNode;
}
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2149,16 +2149,22 @@ nsDisplayListBuilder::AppendNewScrollInf
MOZ_ASSERT(ShouldBuildScrollInfoItemsForHoisting());
MOZ_ASSERT(mScrollInfoItemsForHoisting);
mScrollInfoItemsForHoisting->AppendNewToTop(aScrollInfoItem);
}
bool
nsDisplayListBuilder::IsBuildingLayerEventRegions()
{
+ if (mBuildCompositorHitTestInfo) {
+ // If we have webrender hit-testing enabled, then we will build the
+ // nsDisplayCompositorHitTestInfo items and use those instead of event
+ // regions, so we don't need to build the event regions.
+ return false;
+ }
if (IsPaintingToWindow()) {
// Note: this function and LayerEventRegionsEnabled are the only places
// that get to query LayoutEventRegionsEnabled 'directly' - other code
// should call this function.
return gfxPrefs::LayoutEventRegionsEnabledDoNotUseDirectly() ||
mAsyncPanZoomEnabled;
}
return false;