зеркало из 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),
|
mHasDisplayPort(false),
|
||||||
mHasFixedItems(false),
|
mHasFixedItems(false),
|
||||||
mIsInFixedPosition(false),
|
mIsInFixedPosition(false),
|
||||||
mIsCompositingCheap(false)
|
mIsCompositingCheap(false),
|
||||||
|
mContainsPluginItem(false)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsDisplayListBuilder);
|
MOZ_COUNT_CTOR(nsDisplayListBuilder);
|
||||||
PL_InitArenaPool(&mPool, "displayListArena", 1024,
|
PL_InitArenaPool(&mPool, "displayListArena", 1024,
|
||||||
|
|
|
@ -582,6 +582,9 @@ public:
|
||||||
return aItem == mGlassDisplayItem;
|
return aItem == mGlassDisplayItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetContainsPluginItem() { mContainsPluginItem = true; }
|
||||||
|
bool ContainsPluginItem() { return mContainsPluginItem; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
|
void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
|
||||||
const nsRect& aDirtyRect);
|
const nsRect& aDirtyRect);
|
||||||
|
@ -635,6 +638,7 @@ private:
|
||||||
bool mHasFixedItems;
|
bool mHasFixedItems;
|
||||||
bool mIsInFixedPosition;
|
bool mIsInFixedPosition;
|
||||||
bool mIsCompositingCheap;
|
bool mIsCompositingCheap;
|
||||||
|
bool mContainsPluginItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsDisplayItem;
|
class nsDisplayItem;
|
||||||
|
|
|
@ -2497,10 +2497,8 @@ nsRootPresContext::ComputePluginGeometryUpdates(nsIFrame* aFrame,
|
||||||
mRegisteredPlugins.EnumerateEntries(SetPluginHidden, aFrame);
|
mRegisteredPlugins.EnumerateEntries(SetPluginHidden, aFrame);
|
||||||
|
|
||||||
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
|
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
|
||||||
if (!rootFrame) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (rootFrame && aBuilder->ContainsPluginItem()) {
|
||||||
aBuilder->SetForPluginGeometry();
|
aBuilder->SetForPluginGeometry();
|
||||||
aBuilder->SetAccurateVisibleRegions();
|
aBuilder->SetAccurateVisibleRegions();
|
||||||
// Merging and flattening has already been done and we should not do it
|
// Merging and flattening has already been done and we should not do it
|
||||||
|
@ -2511,6 +2509,7 @@ nsRootPresContext::ComputePluginGeometryUpdates(nsIFrame* aFrame,
|
||||||
// nsDisplayPlugin::ComputeVisibility will automatically set a non-hidden
|
// nsDisplayPlugin::ComputeVisibility will automatically set a non-hidden
|
||||||
// widget configuration for the plugin, if it's visible.
|
// widget configuration for the plugin, if it's visible.
|
||||||
aList->ComputeVisibilityForRoot(aBuilder, ®ion);
|
aList->ComputeVisibilityForRoot(aBuilder, ®ion);
|
||||||
|
}
|
||||||
|
|
||||||
InitApplyPluginGeometryTimer();
|
InitApplyPluginGeometryTimer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,6 +310,7 @@ public:
|
||||||
: nsDisplayItem(aBuilder, aFrame)
|
: nsDisplayItem(aBuilder, aFrame)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsDisplayPlugin);
|
MOZ_COUNT_CTOR(nsDisplayPlugin);
|
||||||
|
aBuilder->SetContainsPluginItem();
|
||||||
}
|
}
|
||||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||||
virtual ~nsDisplayPlugin() {
|
virtual ~nsDisplayPlugin() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче