diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 313d0cdb447d..d2bba6b3db30 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -31,7 +31,7 @@ namespace mozilla { namespace layers { struct LayerPropertiesBase; -UniquePtr CloneLayerTreePropertiesInternal(Layer* aRoot); +LayerPropertiesBase* CloneLayerTreePropertiesInternal(Layer* aRoot); static nsIntRect TransformRect(const nsIntRect& aRect, const Matrix4x4& aTransform) @@ -199,7 +199,7 @@ struct LayerPropertiesBase : public LayerProperties } nsRefPtr mLayer; - UniquePtr mMaskLayer; + nsAutoPtr mMaskLayer; nsIntRegion mVisibleRegion; nsIntRegion mInvalidRegion; Matrix4x4 mTransform; @@ -218,7 +218,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase , mPreYScale(aLayer->GetPreYScale()) { for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) { - mChildren.AppendElement(Move(CloneLayerTreePropertiesInternal(child))); + mChildren.AppendElement(CloneLayerTreePropertiesInternal(child)); } } @@ -315,7 +315,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase } // The old list of children: - nsAutoTArray,1> mChildren; + nsAutoTArray,1> mChildren; float mPreXScale; float mPreYScale; }; @@ -383,29 +383,29 @@ struct ImageLayerProperties : public LayerPropertiesBase ScaleMode mScaleMode; }; -UniquePtr +LayerPropertiesBase* CloneLayerTreePropertiesInternal(Layer* aRoot) { if (!aRoot) { - return MakeUnique(); + return new LayerPropertiesBase(); } switch (aRoot->GetType()) { case Layer::TYPE_CONTAINER: case Layer::TYPE_REF: - return MakeUnique(aRoot->AsContainerLayer()); + return new ContainerLayerProperties(aRoot->AsContainerLayer()); case Layer::TYPE_COLOR: - return MakeUnique(static_cast(aRoot)); + return new ColorLayerProperties(static_cast(aRoot)); case Layer::TYPE_IMAGE: - return MakeUnique(static_cast(aRoot)); + return new ImageLayerProperties(static_cast(aRoot)); default: - return MakeUnique(aRoot); + return new LayerPropertiesBase(aRoot); } return nullptr; } -/* static */ UniquePtr +/* static */ LayerProperties* LayerProperties::CloneFrom(Layer* aRoot) { return CloneLayerTreePropertiesInternal(aRoot); diff --git a/gfx/layers/LayerTreeInvalidation.h b/gfx/layers/LayerTreeInvalidation.h index ab71b65e554c..37640de2a9e4 100644 --- a/gfx/layers/LayerTreeInvalidation.h +++ b/gfx/layers/LayerTreeInvalidation.h @@ -7,7 +7,6 @@ #define GFX_LAYER_TREE_INVALIDATION_H #include "nsRegion.h" // for nsIntRegion -#include "mozilla/UniquePtr.h" // for UniquePtr class nsPresContext; struct nsIntPoint; @@ -43,7 +42,7 @@ struct LayerProperties * @param Layer tree to copy, or nullptr if we have no * initial layer tree. */ - static UniquePtr CloneFrom(Layer* aRoot); + static LayerProperties* CloneFrom(Layer* aRoot); /** * Clear all invalidation status from this layer tree. diff --git a/gfx/layers/composite/ContentHost.h b/gfx/layers/composite/ContentHost.h index 7e7035646206..40580fcea78a 100644 --- a/gfx/layers/composite/ContentHost.h +++ b/gfx/layers/composite/ContentHost.h @@ -23,7 +23,7 @@ #include "mozilla/layers/LayersTypes.h" // for etc #include "mozilla/layers/TextureHost.h" // for TextureHost #include "mozilla/mozalloc.h" // for operator delete -#include "mozilla/UniquePtr.h" // for UniquePtr +#include "nsAutoPtr.h" // for nsAutoPtr #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_RUNTIMEABORT #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc @@ -375,7 +375,7 @@ private: nsIntPoint mBufferRotation; }; - nsTArray > mUpdateList; + nsTArray > mUpdateList; // Specific to OGL to avoid exposing methods on TextureSource that only // have one implementation. diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 6feac748ad0b..62152fde854b 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -340,7 +340,7 @@ LayerManagerComposite::RenderDebugOverlay(const Rect& aBounds) if (drawFps) { if (!mFPS) { - mFPS = MakeUnique(); + mFPS = new FPSState(); } float fillRatio = mCompositor->GetFillRatio(); diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index a1ac23cedb1b..d5183186e55c 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -19,7 +19,6 @@ #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/LayersTypes.h" // for LayersBackend, etc #include "mozilla/RefPtr.h" -#include "mozilla/UniquePtr.h" #include "nsAString.h" #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMPtr.h" // for already_AddRefed @@ -268,7 +267,7 @@ private: void WorldTransformRect(nsIntRect& aRect); RefPtr mCompositor; - UniquePtr mClonedLayerTreeProperties; + nsAutoPtr mClonedLayerTreeProperties; /** * Context target, nullptr when drawing directly to our swap chain. @@ -278,7 +277,7 @@ private: gfx::Matrix mWorldMatrix; nsIntRegion mInvalidRegion; - UniquePtr mFPS; + nsAutoPtr mFPS; bool mInTransaction; bool mIsCompositorReady; diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 2c984c85f942..e8ee855ddb1e 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -3172,7 +3172,7 @@ FrameLayerBuilder::AddThebesDisplayItem(ThebesLayerData* aLayerData, layerBuilder->DidBeginRetainedLayerTransaction(tempManager); } - UniquePtr props(LayerProperties::CloneFrom(tempManager->GetRoot())); + nsAutoPtr props(LayerProperties::CloneFrom(tempManager->GetRoot())); nsRefPtr tmpLayer = aItem->BuildLayer(mDisplayListBuilder, tempManager, ContainerLayerParameters()); // We have no easy way of detecting if this transaction will ever actually get finished. diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index b2e9bb9bef7a..db4bc9dc2266 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -50,7 +50,6 @@ #include "mozilla/EventStates.h" #include "mozilla/LookAndFeel.h" #include "mozilla/Preferences.h" -#include "mozilla/UniquePtr.h" #include "ActiveLayerTracker.h" #include "nsContentUtils.h" #include "nsPrintfCString.h" @@ -1250,10 +1249,9 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, (!layerManager->IsCompositingCheap() && layerManager->NeedsWidgetInvalidation())) && widgetTransaction; - UniquePtr props; - if (computeInvalidRect) { - props = Move(LayerProperties::CloneFrom(layerManager->GetRoot())); - } + nsAutoPtr props(computeInvalidRect ? + LayerProperties::CloneFrom(layerManager->GetRoot()) : + nullptr); ContainerLayerParameters containerParameters (presShell->GetXResolution(), presShell->GetYResolution()); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1fbb457bd953..b0e60152b64b 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -35,7 +35,6 @@ #include "mozilla/MouseEvents.h" #include "mozilla/TextEvents.h" #include "mozilla/TouchEvents.h" -#include "mozilla/UniquePtr.h" #include #ifdef XP_WIN @@ -6185,10 +6184,9 @@ PresShell::Paint(nsView* aViewToPaint, bool computeInvalidRect = computeInvalidFunc || (layerManager->GetBackendType() == LayersBackend::LAYERS_BASIC); - UniquePtr props; - if (computeInvalidRect) { - props = Move(LayerProperties::CloneFrom(layerManager->GetRoot())); - } + nsAutoPtr props(computeInvalidRect ? + LayerProperties::CloneFrom(layerManager->GetRoot()) : + nullptr); MaybeSetupTransactionIdAllocator(layerManager, aViewToPaint);