diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index 5ffc32f1631c..12fb4559b00f 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -74,7 +74,6 @@ using namespace mozilla; typedef mozilla::dom::GamepadPlatformService GamepadPlatformService; nsIGeolocationUpdate *gLocationCallback = nullptr; -nsAutoPtr gLastSizeChange; nsAppShell* nsAppShell::sAppShell; StaticAutoPtr nsAppShell::sAppShellLock; diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 63afd44bf752..2e62f4251a33 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -13,7 +13,6 @@ #include "mozAccessibleProtocol.h" #endif -#include "nsAutoPtr.h" #include "nsISupports.h" #include "nsBaseWidget.h" #include "nsWeakPtr.h" @@ -627,7 +626,7 @@ protected: // Used in OMTC BasicLayers mode. Presents the BasicCompositor result // surface to the screen using an OpenGL context. - nsAutoPtr mGLPresenter; + mozilla::UniquePtr mGLPresenter; mozilla::UniquePtr mVibrancyManager; RefPtr mSwipeTracker; diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index b994d632643b..6e171da24a73 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -275,12 +275,12 @@ namespace { class GLPresenter : public GLManager { public: - static GLPresenter* CreateForWindow(nsIWidget* aWindow) + static mozilla::UniquePtr CreateForWindow(nsIWidget* aWindow) { // Contrary to CompositorOGL, we allow unaccelerated OpenGL contexts to be // used. BasicCompositor only requires very basic GL functionality. RefPtr context = gl::GLContextProvider::CreateForWindow(aWindow, false); - return context ? new GLPresenter(context) : nullptr; + return context ? MakeUnique(context) : nullptr; } explicit GLPresenter(GLContext* aContext); @@ -291,7 +291,7 @@ public: { MOZ_ASSERT(aTarget == LOCAL_GL_TEXTURE_RECTANGLE_ARB); MOZ_ASSERT(aFormat == gfx::SurfaceFormat::R8G8B8A8); - return mRGBARectProgram; + return mRGBARectProgram.get(); } virtual const gfx::Matrix4x4& GetProjMatrix() const override { @@ -315,7 +315,7 @@ public: protected: RefPtr mGLContext; - nsAutoPtr mRGBARectProgram; + mozilla::UniquePtr mRGBARectProgram; gfx::Matrix4x4 mProjMatrix; GLuint mQuadVBO; }; @@ -1988,7 +1988,7 @@ nsChildView::CleanupWindowEffects() bool nsChildView::PreRender(LayerManagerComposite* aManager) { - nsAutoPtr manager(GLManager::CreateGLManager(aManager)); + UniquePtr manager(GLManager::CreateGLManager(aManager)); if (!manager) { return true; } @@ -2010,7 +2010,7 @@ nsChildView::PreRender(LayerManagerComposite* aManager) void nsChildView::PostRender(LayerManagerComposite* aManager) { - nsAutoPtr manager(GLManager::CreateGLManager(aManager)); + UniquePtr manager(GLManager::CreateGLManager(aManager)); if (!manager) { return; } @@ -2023,9 +2023,9 @@ void nsChildView::DrawWindowOverlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) { - nsAutoPtr manager(GLManager::CreateGLManager(aManager)); + mozilla::UniquePtr manager(GLManager::CreateGLManager(aManager)); if (manager) { - DrawWindowOverlay(manager, aRect); + DrawWindowOverlay(manager.get(), aRect); } } @@ -2718,11 +2718,11 @@ nsChildView::DoRemoteComposition(const LayoutDeviceIntRect& aRenderRect) mGLPresenter->BeginFrame(aRenderRect.Size()); // Draw the result from the basic compositor. - mBasicCompositorImage->Draw(mGLPresenter, LayoutDeviceIntPoint(0, 0)); + mBasicCompositorImage->Draw(mGLPresenter.get(), LayoutDeviceIntPoint(0, 0)); // DrawWindowOverlay doesn't do anything for non-GL, so it didn't paint // anything during the basic compositor transaction. Draw the overlay now. - DrawWindowOverlay(mGLPresenter, aRenderRect); + DrawWindowOverlay(mGLPresenter.get(), aRenderRect); mGLPresenter->EndFrame(); @@ -3008,7 +3008,7 @@ GLPresenter::GLPresenter(GLContext* aContext) mGLContext->MakeCurrent(); ShaderConfigOGL config; config.SetTextureTarget(LOCAL_GL_TEXTURE_RECTANGLE_ARB); - mRGBARectProgram = new ShaderProgramOGL(mGLContext, + mRGBARectProgram = MakeUnique(mGLContext, ProgramProfileOGL::GetProfileFor(config)); // Create mQuadVBO.