mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 897839. Use OMTC for invisible windows and initialise LayerTreeState::mParent. r=mattwoodrow
This commit is contained in:
parent
ad3bd7c048
commit
fb76e04605
@ -32,6 +32,11 @@ using namespace std;
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
CompositorParent::LayerTreeState::LayerTreeState()
|
||||
: mParent(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
typedef map<uint64_t, CompositorParent::LayerTreeState> LayerTreeMap;
|
||||
static LayerTreeMap sIndirectLayerTrees;
|
||||
|
||||
@ -912,9 +917,9 @@ CrossProcessCompositorParent::AllocPLayerTransactionParent(const LayersBackend&
|
||||
MOZ_ASSERT(aId != 0);
|
||||
|
||||
if (sIndirectLayerTrees[aId].mParent) {
|
||||
nsRefPtr<LayerManager> lm = sIndirectLayerTrees[aId].mParent->GetLayerManager();
|
||||
LayerManagerComposite* lm = sIndirectLayerTrees[aId].mParent->GetLayerManager();
|
||||
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
||||
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, aId);
|
||||
return new LayerTransactionParent(lm, this, aId);
|
||||
}
|
||||
|
||||
NS_WARNING("Created child without a matching parent?");
|
||||
|
@ -177,9 +177,10 @@ public:
|
||||
PlatformThreadId aThreadID);
|
||||
|
||||
struct LayerTreeState {
|
||||
LayerTreeState();
|
||||
nsRefPtr<Layer> mRoot;
|
||||
nsRefPtr<GeckoContentController> mController;
|
||||
CompositorParent *mParent;
|
||||
CompositorParent* mParent;
|
||||
TargetConfig mTargetConfig;
|
||||
};
|
||||
|
||||
|
@ -848,12 +848,8 @@ nsBaseWidget::ComputeShouldAccelerate(bool aDefault)
|
||||
}
|
||||
#endif
|
||||
|
||||
// We don't want to accelerate small popup windows like menu, but we still
|
||||
// want to accelerate xul panels that may contain arbitrarily complex content.
|
||||
bool isSmallPopup = ((mWindowType == eWindowType_popup) &&
|
||||
(mPopupType != ePopupTypePanel));
|
||||
// we should use AddBoolPrefVarCache
|
||||
bool disableAcceleration = isSmallPopup || gfxPlatform::GetPrefLayersAccelerationDisabled() || (mWindowType == eWindowType_invisible);
|
||||
bool disableAcceleration = IsSmallPopup() || gfxPlatform::GetPrefLayersAccelerationDisabled();
|
||||
mForceLayersAcceleration = gfxPlatform::GetPrefLayersAccelerationForceEnabled();
|
||||
|
||||
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
|
||||
@ -976,11 +972,15 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
|
||||
// deallocated it when being freed.
|
||||
}
|
||||
|
||||
bool nsBaseWidget::IsSmallPopup()
|
||||
{
|
||||
return mWindowType == eWindowType_popup &&
|
||||
mPopupType != ePopupTypePanel;
|
||||
}
|
||||
|
||||
bool nsBaseWidget::ShouldUseOffMainThreadCompositing()
|
||||
{
|
||||
bool isSmallPopup = ((mWindowType == eWindowType_popup) &&
|
||||
(mPopupType != ePopupTypePanel)) || (mWindowType == eWindowType_invisible);
|
||||
return CompositorParent::CompositorLoop() && !isSmallPopup;
|
||||
return CompositorParent::CompositorLoop() && !IsSmallPopup();
|
||||
}
|
||||
|
||||
LayerManager* nsBaseWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
|
||||
|
@ -319,6 +319,11 @@ protected:
|
||||
// if the new rectangles are different from the old rectangles.
|
||||
bool StoreWindowClipRegion(const nsTArray<nsIntRect>& aRects);
|
||||
|
||||
// We don't want to accelerate small popup windows like menu, but we still
|
||||
// want to accelerate xul panels that may contain arbitrarily complex content.
|
||||
bool IsSmallPopup();
|
||||
|
||||
|
||||
virtual already_AddRefed<nsIWidget>
|
||||
AllocateChildPopupWidget()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user