diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 955dc44aa69..441c2b9fc79 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -32,6 +32,11 @@ using namespace std; namespace mozilla { namespace layers { +CompositorParent::LayerTreeState::LayerTreeState() + : mParent(nullptr) +{ +} + typedef map LayerTreeMap; static LayerTreeMap sIndirectLayerTrees; @@ -912,9 +917,9 @@ CrossProcessCompositorParent::AllocPLayerTransactionParent(const LayersBackend& MOZ_ASSERT(aId != 0); if (sIndirectLayerTrees[aId].mParent) { - nsRefPtr 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?"); diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h index 392687f4276..b48949a840b 100644 --- a/gfx/layers/ipc/CompositorParent.h +++ b/gfx/layers/ipc/CompositorParent.h @@ -177,9 +177,10 @@ public: PlatformThreadId aThreadID); struct LayerTreeState { + LayerTreeState(); nsRefPtr mRoot; nsRefPtr mController; - CompositorParent *mParent; + CompositorParent* mParent; TargetConfig mTargetConfig; }; diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index a1f959f5885..08cea5de157 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -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, diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index ef35c1b5f94..6bf13d622e7 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -319,6 +319,11 @@ protected: // if the new rectangles are different from the old rectangles. bool StoreWindowClipRegion(const nsTArray& 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 AllocateChildPopupWidget() {