Bug 1394695 - Don't push scrolling clips in layers-free WR if APZ is disabled. r=mstange

MozReview-Commit-ID: AesXui61mB2

--HG--
extra : rebase_source : bd8d1adacb3be142cc5227e9bae347abf0ddc14d
This commit is contained in:
Kartikaya Gupta 2017-09-12 10:33:45 -04:00
parent 0adcdd620d
commit 0473ebc109
3 changed files with 13 additions and 3 deletions

View File

@ -89,7 +89,8 @@ ScrollingLayersHelper::ScrollingLayersHelper(WebRenderLayer* aLayer,
ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aStackingContext,
WebRenderLayerManager::ClipIdMap& aCache)
WebRenderLayerManager::ClipIdMap& aCache,
bool aApzEnabled)
: mLayer(nullptr)
, mBuilder(&aBuilder)
, mPushedLayerLocalClip(false)
@ -97,6 +98,14 @@ ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
{
int32_t auPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
if (!aApzEnabled) {
// If APZ is not enabled, we can ignore all the stuff with ASRs; we just
// need to define the clip chain on the item and that's it.
DefineAndPushChain(aItem->GetClipChain(), aBuilder, aStackingContext,
auPerDevPixel, aCache);
return;
}
// There are two ASR chains here that we need to be fully defined. One is the
// ASR chain pointed to by aItem->GetActiveScrolledRoot(). The other is the
// ASR chain pointed to by aItem->GetClipChain()->mASR. We pick the leafmost

View File

@ -33,7 +33,8 @@ public:
ScrollingLayersHelper(nsDisplayItem* aItem,
wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aStackingContext,
WebRenderLayerManager::ClipIdMap& aCache);
WebRenderLayerManager::ClipIdMap& aCache,
bool aApzEnabled);
~ScrollingLayersHelper();
private:

View File

@ -328,7 +328,7 @@ WebRenderLayerManager::CreateWebRenderCommandsFromDisplayList(nsDisplayList* aDi
}
{ // scope the ScrollingLayersHelper
ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache);
ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache, AsyncPanZoomEnabled());
// Note: this call to CreateWebRenderCommands can recurse back into
// this function if the |item| is a wrapper for a sublist.