Bug 1119942 - Stop generating scrollinfo layers if event-regions are enabled. r=tnikkel,botond

This commit is contained in:
Kartikaya Gupta 2015-01-20 09:49:30 -05:00
parent 5ee5b0071b
commit 7dcd094756
3 changed files with 23 additions and 3 deletions

View File

@ -329,9 +329,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
if (!aMetrics.IsScrollable()) {
needsApzc = false;
}
if (gfxPrefs::LayoutEventRegionsEnabled() && aLayer.IsScrollInfoLayer()) {
needsApzc = false;
}
const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aLayersId);
if (!(state && state->mController.get())) {

View File

@ -4619,11 +4619,30 @@ nsDisplayScrollInfoLayer::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
return nsDisplayWrapList::GetBounds(aBuilder, aSnap);
}
already_AddRefed<Layer>
nsDisplayScrollInfoLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters)
{
// Only build scrollinfo layers if event-regions are disabled, so that the
// compositor knows where the inactive scrollframes are. When event-regions
// are enabled, the dispatch-to-content regions provide this information to
// the APZ code.
if (gfxPrefs::LayoutEventRegionsEnabled()) {
return nullptr;
}
return nsDisplayScrollLayer::BuildLayer(aBuilder, aManager, aContainerParameters);
}
LayerState
nsDisplayScrollInfoLayer::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters)
{
// See comment in BuildLayer
if (gfxPrefs::LayoutEventRegionsEnabled()) {
return LAYER_NONE;
}
return LAYER_ACTIVE_EMPTY;
}

View File

@ -3210,6 +3210,10 @@ public:
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE;