зеркало из https://github.com/mozilla/gecko-dev.git
Bug 642257. If there are no plugins in the display list skip a potentially expensive compute visibility pass with accurate visible regions to determine plugin geometry because it is not needed. r=roc, a=bajaj
If there is a plugin in a background tab and a complex scene in a foreground tab the accurate visible regions can cause us to bog down, for no good reason.
This commit is contained in:
Родитель
6b03e1bc33
Коммит
ea56aaf4e7
|
@ -448,7 +448,8 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
|||
mHasDisplayPort(false),
|
||||
mHasFixedItems(false),
|
||||
mIsInFixedPosition(false),
|
||||
mIsCompositingCheap(false)
|
||||
mIsCompositingCheap(false),
|
||||
mContainsPluginItem(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayListBuilder);
|
||||
PL_InitArenaPool(&mPool, "displayListArena", 1024,
|
||||
|
|
|
@ -582,6 +582,9 @@ public:
|
|||
return aItem == mGlassDisplayItem;
|
||||
}
|
||||
|
||||
void SetContainsPluginItem() { mContainsPluginItem = true; }
|
||||
bool ContainsPluginItem() { return mContainsPluginItem; }
|
||||
|
||||
private:
|
||||
void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
|
||||
const nsRect& aDirtyRect);
|
||||
|
@ -635,6 +638,7 @@ private:
|
|||
bool mHasFixedItems;
|
||||
bool mIsInFixedPosition;
|
||||
bool mIsCompositingCheap;
|
||||
bool mContainsPluginItem;
|
||||
};
|
||||
|
||||
class nsDisplayItem;
|
||||
|
|
|
@ -2497,20 +2497,19 @@ nsRootPresContext::ComputePluginGeometryUpdates(nsIFrame* aFrame,
|
|||
mRegisteredPlugins.EnumerateEntries(SetPluginHidden, aFrame);
|
||||
|
||||
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
|
||||
if (!rootFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
aBuilder->SetForPluginGeometry();
|
||||
aBuilder->SetAccurateVisibleRegions();
|
||||
// Merging and flattening has already been done and we should not do it
|
||||
// again. nsDisplayScroll(Info)Layer doesn't support trying to flatten
|
||||
// again.
|
||||
aBuilder->SetAllowMergingAndFlattening(false);
|
||||
nsRegion region = rootFrame->GetVisualOverflowRectRelativeToSelf();
|
||||
// nsDisplayPlugin::ComputeVisibility will automatically set a non-hidden
|
||||
// widget configuration for the plugin, if it's visible.
|
||||
aList->ComputeVisibilityForRoot(aBuilder, ®ion);
|
||||
if (rootFrame && aBuilder->ContainsPluginItem()) {
|
||||
aBuilder->SetForPluginGeometry();
|
||||
aBuilder->SetAccurateVisibleRegions();
|
||||
// Merging and flattening has already been done and we should not do it
|
||||
// again. nsDisplayScroll(Info)Layer doesn't support trying to flatten
|
||||
// again.
|
||||
aBuilder->SetAllowMergingAndFlattening(false);
|
||||
nsRegion region = rootFrame->GetVisualOverflowRectRelativeToSelf();
|
||||
// nsDisplayPlugin::ComputeVisibility will automatically set a non-hidden
|
||||
// widget configuration for the plugin, if it's visible.
|
||||
aList->ComputeVisibilityForRoot(aBuilder, ®ion);
|
||||
}
|
||||
|
||||
InitApplyPluginGeometryTimer();
|
||||
}
|
||||
|
|
|
@ -310,6 +310,7 @@ public:
|
|||
: nsDisplayItem(aBuilder, aFrame)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayPlugin);
|
||||
aBuilder->SetContainsPluginItem();
|
||||
}
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual ~nsDisplayPlugin() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче