Bug 1576390 - Remove the prefs gfx.core-animation.enabled and gfx.compositor.glcontext.opaque, and all the code needed to support it. r=mattwoodrow,spohl
authorMarkus Stange <mstange@themasta.com>
Wed, 13 Nov 2019 19:07:37 +0000
changeset 501829 fbab3b7be09261b604148655537ba0ff90d2a9fb
parent 501828 8265027727efb5904ceb3efd7c20d07f28119f2b
child 501830 628967f53151659cf2666e15d50f37fd80952d9a
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, spohl
bugs1576390
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1576390 - Remove the prefs gfx.core-animation.enabled and gfx.compositor.glcontext.opaque, and all the code needed to support it. r=mattwoodrow,spohl Differential Revision: https://phabricator.services.mozilla.com/D52739
gfx/gl/GLContextProviderCGL.mm
gfx/layers/opengl/CompositorOGL.cpp
gfx/webrender_bindings/RenderCompositorOGL.cpp
modules/libpref/init/StaticPrefList.yaml
widget/cocoa/RectTextureImage.h
widget/cocoa/RectTextureImage.mm
widget/cocoa/moz.build
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -111,24 +111,20 @@ bool GLContextCGL::IsCurrentImpl() const
 
 GLenum GLContextCGL::GetPreferredARGB32Format() const { return LOCAL_GL_BGRA; }
 
 bool GLContextCGL::IsDoubleBuffered() const { return sCGLLibrary.UseDoubleBufferedWindows(); }
 
 bool GLContextCGL::SwapBuffers() {
   AUTO_PROFILER_LABEL("GLContextCGL::SwapBuffers", GRAPHICS);
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    // We do not have a framebuffer zero. Just do a flush.
-    // Flushing is necessary if we want our IOSurfaces to have the correct
-    // content once they're picked up by the WindowServer from our CALayers.
-    fFlush();
-  } else {
-    [mContext flushBuffer];
-  }
+  // We do not have a default framebuffer. Just do a flush.
+  // Flushing is necessary if we want our IOSurfaces to have the correct
+  // content once they're picked up by the WindowServer from our CALayers.
+  fFlush();
 
   return true;
 }
 
 void GLContextCGL::GetWSIInfo(nsCString* const out) const { out->AppendLiteral("CGL"); }
 
 Maybe<SymbolLoader> GLContextCGL::GetSymbolLoader() const {
   const auto& lib = sCGLLibrary.Library();
@@ -212,19 +208,16 @@ already_AddRefed<GLContext> GLContextPro
   } else {
     attribs = aForceAccelerated ? kAttribs_singleBuffered_accel : kAttribs_singleBuffered;
   }
   NSOpenGLContext* context = CreateWithFormat(attribs);
   if (!context) {
     return nullptr;
   }
 
-  GLint opaque = StaticPrefs::gfx_compositor_glcontext_opaque();
-  [context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
-
   RefPtr<GLContextCGL> glContext = new GLContextCGL(CreateContextFlags::NONE, caps, context, false);
 
   if (!glContext->Init()) {
     glContext = nullptr;
     [context release];
     return nullptr;
   }
 
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -2052,23 +2052,21 @@ void CompositorOGL::EndFrame() {
 
   Compositor::EndFrame();
 }
 
 void CompositorOGL::InsertFrameDoneSync() {
 #ifdef XP_MACOSX
   // Only do this on macOS.
   // On other platforms, SwapBuffers automatically applies back-pressure.
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    if (mThisFrameDoneSync) {
-      mGLContext->fDeleteSync(mThisFrameDoneSync);
-    }
-    mThisFrameDoneSync =
-        mGLContext->fFenceSync(LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+  if (mThisFrameDoneSync) {
+    mGLContext->fDeleteSync(mThisFrameDoneSync);
   }
+  mThisFrameDoneSync =
+      mGLContext->fFenceSync(LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
 #endif
 }
 
 void CompositorOGL::WaitForGPU() {
   if (mPreviousFrameDoneSync) {
     AUTO_PROFILER_LABEL("Waiting for GPU to finish previous frame", GRAPHICS);
     mGLContext->fClientWaitSync(mPreviousFrameDoneSync,
                                 LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT,
--- a/gfx/webrender_bindings/RenderCompositorOGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorOGL.cpp
@@ -110,23 +110,20 @@ RenderedFrameId RenderCompositorOGL::End
 
   return frameId;
 }
 
 void RenderCompositorOGL::InsertFrameDoneSync() {
 #ifdef XP_MACOSX
   // Only do this on macOS.
   // On other platforms, SwapBuffers automatically applies back-pressure.
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    if (mThisFrameDoneSync) {
-      mGL->fDeleteSync(mThisFrameDoneSync);
-    }
-    mThisFrameDoneSync =
-        mGL->fFenceSync(LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+  if (mThisFrameDoneSync) {
+    mGL->fDeleteSync(mThisFrameDoneSync);
   }
+  mThisFrameDoneSync = mGL->fFenceSync(LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
 #endif
 }
 
 bool RenderCompositorOGL::WaitForGPU() {
   if (mPreviousFrameDoneSync) {
     AUTO_PROFILER_LABEL("Waiting for GPU to finish previous frame", GRAPHICS);
     mGL->fClientWaitSync(mPreviousFrameDoneSync,
                          LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT,
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -3249,30 +3249,16 @@
   value: 0
   mirror: always
 
 - name: gfx.compositor.clearstate
   type: RelaxedAtomicBool
   value: false
   mirror: always
 
-- name: gfx.compositor.glcontext.opaque
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-
-- name: gfx.core-animation.enabled
-  type: bool
-#if defined(XP_MACOSX)
-  value: true
-#else
-  value: false
-#endif
-  mirror: once
-
 #if defined(MOZ_WIDGET_ANDROID)
   # Overrides the glClear color used when the surface origin is not (0, 0)
   # Used for drawing a border around the content.
 -   name: gfx.compositor.override.clear-color.r
     type: AtomicFloat
     value: 0.0f
     mirror: always
 
deleted file mode 100644
--- a/widget/cocoa/RectTextureImage.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef RectTextureImage_h_
-#define RectTextureImage_h_
-
-#include "GLTypes.h"
-#include "mozilla/gfx/2D.h"
-#include "mozilla/RefPtr.h"
-#include "Units.h"
-
-class MacIOSurface;
-
-namespace mozilla {
-
-namespace gl {
-class GLContext;
-}  // namespace gl
-
-namespace layers {
-class GLManager;
-}  // namespace layers
-
-namespace widget {
-
-// Manages a texture which can resize dynamically, binds to the
-// LOCAL_GL_TEXTURE_RECTANGLE_ARB texture target and is automatically backed
-// by a power-of-two size GL texture. The latter two features are used for
-// compatibility with older Mac hardware which we block GL layers on.
-// RectTextureImages are used both for accelerated GL layers drawing and for
-// OMTC BasicLayers drawing.
-class RectTextureImage {
- public:
-  RectTextureImage();
-
-  virtual ~RectTextureImage();
-
-  already_AddRefed<gfx::DrawTarget> BeginUpdate(
-      const LayoutDeviceIntSize& aNewSize,
-      const LayoutDeviceIntRegion& aDirtyRegion = LayoutDeviceIntRegion());
-  void EndUpdate();
-
-  void UpdateIfNeeded(const LayoutDeviceIntSize& aNewSize,
-                      const LayoutDeviceIntRegion& aDirtyRegion,
-                      void (^aCallback)(gfx::DrawTarget*, const LayoutDeviceIntRegion&)) {
-    RefPtr<gfx::DrawTarget> drawTarget = BeginUpdate(aNewSize, aDirtyRegion);
-    if (drawTarget) {
-      aCallback(drawTarget, GetUpdateRegion());
-      EndUpdate();
-    }
-  }
-
-  void UpdateFromCGContext(const LayoutDeviceIntSize& aNewSize,
-                           const LayoutDeviceIntRegion& aDirtyRegion, CGContextRef aCGContext);
-
-  LayoutDeviceIntRegion GetUpdateRegion() {
-    MOZ_ASSERT(mInUpdate, "update region only valid during update");
-    return mUpdateRegion;
-  }
-
-  void Draw(mozilla::layers::GLManager* aManager, const LayoutDeviceIntPoint& aLocation,
-            const gfx::Matrix4x4& aTransform = gfx::Matrix4x4());
-
- protected:
-  void DeleteTexture();
-  bool BindIOSurfaceToTexture(gl::GLContext* aGL);
-
-  RefPtr<MacIOSurface> mIOSurface;
-  gl::GLContext* mGLContext;
-  LayoutDeviceIntRegion mUpdateRegion;
-  LayoutDeviceIntSize mBufferSize;
-  GLuint mTexture;
-  bool mInUpdate;
-};
-
-}  // namespace widget
-}  // namespace mozilla
-
-#endif  // RectTextureImage_h_
deleted file mode 100644
--- a/widget/cocoa/RectTextureImage.mm
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: objc; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "RectTextureImage.h"
-
-#include "gfxUtils.h"
-#include "GLContextCGL.h"
-#include "mozilla/layers/GLManager.h"
-#include "mozilla/gfx/MacIOSurface.h"
-#include "OGLShaderProgram.h"
-#include "ScopedGLHelpers.h"
-
-namespace mozilla {
-namespace widget {
-
-RectTextureImage::RectTextureImage() : mGLContext(nullptr), mTexture(0), mInUpdate(false) {}
-
-RectTextureImage::~RectTextureImage() { DeleteTexture(); }
-
-already_AddRefed<gfx::DrawTarget> RectTextureImage::BeginUpdate(
-    const LayoutDeviceIntSize& aNewSize, const LayoutDeviceIntRegion& aDirtyRegion) {
-  MOZ_ASSERT(!mInUpdate, "Beginning update during update!");
-  mUpdateRegion = aDirtyRegion;
-  bool needRecreate = false;
-  if (aNewSize != mBufferSize) {
-    mBufferSize = aNewSize;
-    mUpdateRegion = LayoutDeviceIntRect(LayoutDeviceIntPoint(0, 0), aNewSize);
-    needRecreate = true;
-  }
-
-  if (mUpdateRegion.IsEmpty()) {
-    return nullptr;
-  }
-
-  if (!mIOSurface || needRecreate) {
-    DeleteTexture();
-    mIOSurface = MacIOSurface::CreateIOSurface(mBufferSize.width, mBufferSize.height);
-
-    if (!mIOSurface) {
-      return nullptr;
-    }
-  }
-
-  mInUpdate = true;
-
-  mIOSurface->Lock(false);
-  unsigned char* ioData = (unsigned char*)mIOSurface->GetBaseAddress();
-  gfx::IntSize size(mBufferSize.width, mBufferSize.height);
-  int32_t stride = mIOSurface->GetBytesPerRow();
-  gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8;
-  RefPtr<gfx::DrawTarget> drawTarget =
-      gfx::Factory::CreateDrawTargetForData(gfx::BackendType::SKIA, ioData, size, stride, format);
-  return drawTarget.forget();
-}
-
-void RectTextureImage::EndUpdate() {
-  MOZ_ASSERT(mInUpdate, "Ending update while not in update");
-  mIOSurface->Unlock(false);
-  mInUpdate = false;
-}
-
-void RectTextureImage::UpdateFromCGContext(const LayoutDeviceIntSize& aNewSize,
-                                           const LayoutDeviceIntRegion& aDirtyRegion,
-                                           CGContextRef aCGContext) {
-  gfx::IntSize size =
-      gfx::IntSize(CGBitmapContextGetWidth(aCGContext), CGBitmapContextGetHeight(aCGContext));
-  RefPtr<gfx::DrawTarget> dt = BeginUpdate(aNewSize, aDirtyRegion);
-  if (dt) {
-    gfx::Rect rect(0, 0, size.width, size.height);
-    gfxUtils::ClipToRegion(dt, GetUpdateRegion().ToUnknownRegion());
-    RefPtr<gfx::SourceSurface> sourceSurface = dt->CreateSourceSurfaceFromData(
-        static_cast<uint8_t*>(CGBitmapContextGetData(aCGContext)), size,
-        CGBitmapContextGetBytesPerRow(aCGContext), gfx::SurfaceFormat::B8G8R8A8);
-    dt->DrawSurface(sourceSurface, rect, rect, gfx::DrawSurfaceOptions(),
-                    gfx::DrawOptions(1.0, gfx::CompositionOp::OP_SOURCE));
-    dt->PopClip();
-    EndUpdate();
-  }
-}
-
-void RectTextureImage::Draw(layers::GLManager* aManager, const LayoutDeviceIntPoint& aLocation,
-                            const gfx::Matrix4x4& aTransform) {
-  gl::GLContext* gl = aManager->gl();
-
-  bool bound = BindIOSurfaceToTexture(gl);
-  if (!bound) {
-    return;
-  }
-
-  layers::ShaderProgramOGL* program =
-      aManager->GetProgram(LOCAL_GL_TEXTURE_RECTANGLE_ARB, gfx::SurfaceFormat::R8G8B8A8);
-
-  gl->fActiveTexture(LOCAL_GL_TEXTURE0);
-  gl::ScopedBindTexture texture(gl, mTexture, LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-
-  aManager->ActivateProgram(program);
-  program->SetProjectionMatrix(aManager->GetProjMatrix());
-  program->SetLayerTransform(gfx::Matrix4x4(aTransform).PostTranslate(aLocation.x, aLocation.y, 0));
-  program->SetTextureTransform(gfx::Matrix4x4());
-  program->SetRenderOffset(nsIntPoint(0, 0));
-  program->SetTexCoordMultiplier(mBufferSize.width, mBufferSize.height);
-  program->SetTextureUnit(0);
-
-  aManager->BindAndDrawQuad(program, gfx::Rect(0.0, 0.0, mBufferSize.width, mBufferSize.height),
-                            gfx::Rect(0.0, 0.0, 1.0f, 1.0f));
-}
-
-void RectTextureImage::DeleteTexture() {
-  if (mTexture) {
-    MOZ_ASSERT(mGLContext);
-    mGLContext->MakeCurrent();
-    mGLContext->fDeleteTextures(1, &mTexture);
-    mTexture = 0;
-  }
-}
-
-bool RectTextureImage::BindIOSurfaceToTexture(gl::GLContext* aGL) {
-  if (!mIOSurface) {
-    // If our size is zero or MacIOSurface::CreateIOSurface failed for some
-    // other reason, there's nothing we can bind.
-    return false;
-  }
-
-  if (!mTexture) {
-    MOZ_ASSERT(aGL);
-    aGL->fGenTextures(1, &mTexture);
-    aGL->fActiveTexture(LOCAL_GL_TEXTURE0);
-    gl::ScopedBindTexture texture(aGL, mTexture, LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-    aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_MIN_FILTER,
-                        LOCAL_GL_LINEAR);
-    aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_MAG_FILTER,
-                        LOCAL_GL_LINEAR);
-    aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T,
-                        LOCAL_GL_CLAMP_TO_EDGE);
-    aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S,
-                        LOCAL_GL_CLAMP_TO_EDGE);
-
-    mIOSurface->CGLTexImageIOSurface2D(aGL, gl::GLContextCGL::Cast(aGL)->GetCGLContext(), 0);
-    mGLContext = aGL;
-  }
-
-  return true;
-}
-
-}  // namespace widget
-}  // namespace mozilla
--- a/widget/cocoa/moz.build
+++ b/widget/cocoa/moz.build
@@ -59,17 +59,16 @@ UNIFIED_SOURCES += [
     'nsToolkit.mm',
     'nsTouchBar.mm',
     'nsTouchBarInputIcon.mm',
     'nsTouchBarUpdater.mm',
     'nsWidgetFactory.mm',
     'nsWindowMap.mm',
     'OSXNotificationCenter.mm',
     'ProcInfo.mm',
-    'RectTextureImage.mm',
     'ScreenHelperCocoa.mm',
     'SwipeTracker.mm',
     'TextInputHandler.mm',
     'VibrancyManager.mm',
     'ViewRegion.mm',
     'WidgetTraceEvent.mm',
 ]
 
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -51,17 +51,16 @@ struct SwipeEventQueue;
 class VibrancyManager;
 namespace layers {
 class GLManager;
 class IAPZCTreeManager;
 class NativeLayerRootCA;
 class NativeLayerCA;
 }  // namespace layers
 namespace widget {
-class RectTextureImage;
 class WidgetRenderingContext;
 }  // namespace widget
 }  // namespace mozilla
 
 @class PixelHostingView;
 
 @interface NSEvent (Undocumented)
 
@@ -72,37 +71,16 @@ class WidgetRenderingContext;
 
 // stage From 10.10.3 for force touch event
 @property(readonly) NSInteger stage;
 
 @end
 
 @interface NSView (Undocumented)
 
-// Draws the title string of a window.
-// Present on NSThemeFrame since at least 10.6.
-// _drawTitleBar is somewhat complex, and has changed over the years
-// since OS X 10.6.  But in that time it's never done anything that
-// would break when called outside of -[NSView drawRect:] (which we
-// sometimes do), or whose output can't be redirected to a
-// CGContextRef object (which we also sometimes do).  This is likely
-// to remain true for the indefinite future.  However we should
-// check _drawTitleBar in each new major version of OS X.  For more
-// information see bug 877767.
-- (void)_drawTitleBar:(NSRect)aRect;
-
-// Returns an NSRect that is the bounding box for all an NSView's dirty
-// rectangles (ones that need to be redrawn).  The full list of dirty
-// rectangles can be obtained by calling -[NSView _dirtyRegion] and then
-// calling -[NSRegion getRects:count:] on what it returns.  Both these
-// methods have been present in the same form since at least OS X 10.5.
-// Unlike -[NSView getRectsBeingDrawn:count:], these methods can be called
-// outside a call to -[NSView drawRect:].
-- (NSRect)_dirtyRect;
-
 // Undocumented method of one or more of NSFrameView's subclasses.  Called
 // when one or more of the titlebar buttons needs to be repositioned, to
 // disappear, or to reappear (say if the window's style changes).  If
 // 'redisplay' is true, the entire titlebar (the window's top 22 pixels) is
 // marked as needing redisplay.  This method has been present in the same
 // format since at least OS X 10.5.
 - (void)_tileTitlebarAndRedisplay:(BOOL)redisplay;
 
@@ -154,37 +132,26 @@ class WidgetRenderingContext;
   // when acceptsFirstMouse: is called, we store the event here (strong)
   NSEvent* mClickThroughMouseDownEvent;
 
   // WheelStart/Stop events should always come in pairs. This BOOL records the
   // last received event so that, when we receive one of the events, we make sure
   // to send its pair event first, in case we didn't yet for any reason.
   BOOL mExpectingWheelStop;
 
-  // Set to YES when our GL surface has been updated and we need to call
-  // updateGLContext on the compositor thread before we composite.
-  // Accesses from different threads are synchronized via mGLContext's
-  // CGLContextObj lock.
-  // Always NO if StaticPrefs::gfx_core_animation_enabled_AtStartup() is true.
-  BOOL mNeedsGLUpdate;
-
   // Whether we're inside updateRootCALayer at the moment.
   BOOL mIsUpdatingLayer;
 
   // Holds our drag service across multiple drag calls. The reference to the
   // service is obtained when the mouse enters the view and is released when
   // the mouse exits or there is a drop. This prevents us from having to
   // re-establish the connection to the service manager many times per second
   // when handling |draggingUpdated:| messages.
   nsIDragService* mDragService;
 
-  // The NSOpenGLContext that is attached to our mPixelHostingView.
-  // Always null if StaticPrefs::gfx_core_animation_enabled_AtStartup() is true.
-  NSOpenGLContext* mGLContext;
-
   // Gestures support
   //
   // mGestureState is used to detect when Cocoa has called both
   // magnifyWithEvent and rotateWithEvent within the same
   // beginGestureWithEvent and endGestureWithEvent sequence. We
   // discard the spurious gesture event so as not to confuse Gecko.
   //
   // mCumulativeMagnification keeps track of the total amount of
@@ -206,38 +173,23 @@ class WidgetRenderingContext;
 #ifdef __LP64__
   // Support for fluid swipe tracking.
   BOOL* mCancelSwipeAnimation;
 #endif
 
   // Whether this uses off-main-thread compositing.
   BOOL mUsingOMTCompositor;
 
-  // The mask image that's used when painting into the titlebar using basic
-  // CGContext painting (i.e. non-accelerated).
-  // Always null if StaticPrefs::gfx_core_animation_enabled_AtStartup() is true.
-  CGImageRef mTopLeftCornerMask;
-
   // Subviews of self, which act as container views for vibrancy views and
   // non-draggable views.
   NSView* mVibrancyViewsContainer;      // [STRONG]
   NSView* mNonDraggableViewsContainer;  // [STRONG]
 
-  // The view that does our drawing. Always non-null.
+  // The layer-backed view that hosts our drawing. Always non-null.
   // This is a subview of self so that it can be ordered on top of mVibrancyViewsContainer.
-  // Drawing in this view can be performed in different ways:
-  // If StaticPrefs::gfx_core_animation_enabled_AtStartup() is true, mPixelHostingView
-  // will be layer-backed and all Gecko rendering will be performed into sublayers of
-  // that view's layer.
-  // If StaticPrefs::gfx_core_animation_enabled_AtStartup() is false, there are two cases:
-  // If mUsingOMTCompositor is false, drawing is performed on the main thread
-  // inside the view's drawRect handler. If mUsingOMTCompositor is true,
-  // mGLContext will be non-null and will be associated with mPixelHostingView,
-  // and rendering will be performed on the compositor thread into mGLContext's
-  // primary framebuffer.
   PixelHostingView* mPixelHostingView;
 
   // Last pressure stage by trackpad's force click
   NSInteger mLastPressureStage;
 }
 
 // class initialization
 + (void)initialize;
@@ -252,22 +204,16 @@ class WidgetRenderingContext;
 - (void)delayedTearDown;
 
 - (void)handleMouseMoved:(NSEvent*)aEvent;
 
 - (void)sendMouseEnterOrExitEvent:(NSEvent*)aEvent
                             enter:(BOOL)aEnter
                          exitFrom:(mozilla::WidgetMouseEvent::ExitFrom)aExitFrom;
 
-- (void)updateGLContext;
-- (void)_surfaceNeedsUpdate:(NSNotification*)notification;
-
-- (bool)preRender:(NSOpenGLContext*)aGLContext;
-- (void)postRender:(NSOpenGLContext*)aGLContext;
-
 // Call this during operations that will likely trigger a main thread
 // CoreAnimation paint of the window, during which Gecko should do its own
 // painting and present the results atomically with that main thread transaction.
 // This method will suspend off-thread window updates so that the upcoming paint
 // can be atomic, and mark the layer as needing display so that
 // HandleMainThreadCATransaction gets called and Gecko gets a chance to paint.
 - (void)ensureNextCompositeIsAtomicWithMainThreadPaint;
 
@@ -468,42 +414,31 @@ class nsChildView final : public nsBaseW
   // Mac specific methods
 
   virtual bool DispatchWindowEvent(mozilla::WidgetGUIEvent& event);
 
   void WillPaintWindow();
   bool PaintWindow(LayoutDeviceIntRegion aRegion);
   bool PaintWindowInDrawTarget(mozilla::gfx::DrawTarget* aDT, const LayoutDeviceIntRegion& aRegion,
                                const mozilla::gfx::IntSize& aSurfaceSize);
-  bool PaintWindowInContext(CGContextRef aContext, const LayoutDeviceIntRegion& aRegion,
-                            mozilla::gfx::IntSize aSurfaceSize);
 
   void PaintWindowInContentLayer();
   void HandleMainThreadCATransaction();
 
 #ifdef ACCESSIBILITY
   already_AddRefed<mozilla::a11y::Accessible> GetDocumentAccessible();
 #endif
 
   virtual void CreateCompositor() override;
-  virtual void PrepareWindowEffects() override;
-  virtual void CleanupWindowEffects() override;
 
   virtual bool WidgetPaintsBackground() override { return true; }
 
-  virtual void AddWindowOverlayWebRenderCommands(
-      mozilla::layers::WebRenderBridgeChild* aWrBridge, mozilla::wr::DisplayListBuilder& aBuilder,
-      mozilla::wr::IpcResourceUpdateQueue& aResourceUpdates) override;
-
   virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) override;
-  bool PreRenderImpl(mozilla::widget::WidgetRenderingContext* aContext);
   virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext) override;
   virtual RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() override;
-  virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aManager,
-                                 LayoutDeviceIntRect aRect) override;
 
   virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;
 
   virtual void UpdateWindowDraggingRegion(const LayoutDeviceIntRegion& aRegion) override;
   LayoutDeviceIntRegion GetNonDraggableRegion() { return mNonDraggableRegion.Region(); }
 
   virtual void ReportSwipeStarted(uint64_t aInputBlockId, bool aStartSwipe) override;
 
@@ -541,22 +476,16 @@ class nsChildView final : public nsBaseW
   }
   CGFloat DevPixelsToCocoaPoints(int32_t aPixels) const {
     return nsCocoaUtils::DevPixelsToCocoaPoints(aPixels, BackingScaleFactor());
   }
   NSRect DevPixelsToCocoaPoints(const LayoutDeviceIntRect& aRect) const {
     return nsCocoaUtils::DevPixelsToCocoaPoints(aRect, BackingScaleFactor());
   }
 
-  already_AddRefed<mozilla::gfx::DrawTarget> StartRemoteDrawingInRegion(
-      LayoutDeviceIntRegion& aInvalidRegion, mozilla::layers::BufferMode* aBufferMode) override;
-  void EndRemoteDrawing() override;
-  void CleanupRemoteDrawing() override;
-  bool InitCompositor(mozilla::layers::Compositor* aCompositor) override;
-
   virtual MOZ_MUST_USE nsresult StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
                                                int32_t aPanelX, int32_t aPanelY,
                                                nsString& aCommitted) override;
 
   virtual void SetPluginFocused(bool& aFocused) override;
 
   bool IsPluginFocused() { return mPluginFocused; }
 
@@ -568,17 +497,16 @@ class nsChildView final : public nsBaseW
   void SwipeFinished();
 
   nsresult SetPrefersReducedMotionOverrideForTest(bool aValue) override;
   nsresult ResetPrefersReducedMotionOverrideForTest() override;
 
   // Called when the main thread enters a phase during which visual changes
   // are imminent and any layer updates on the compositor thread would interfere
   // with visual atomicity.
-  // Has no effect if StaticPrefs::gfx_core_animation_enabled_AtStartup() is false.
   // "Async" CATransactions are CATransactions which happen on a thread that's
   // not the main thread.
   void SuspendAsyncCATransactions();
 
   // Called when we know that the current main thread paint will be completed once
   // the main thread goes back to the event loop.
   void MaybeScheduleUnsuspendAsyncCATransactions();
 
@@ -598,29 +526,16 @@ class nsChildView final : public nsBaseW
 
   virtual already_AddRefed<nsIWidget> AllocateChildPopupWidget() override {
     return nsIWidget::CreateTopLevelWindow();
   }
 
   void ConfigureAPZCTreeManager() override;
   void ConfigureAPZControllerThread() override;
 
-  void DoRemoteComposition(const LayoutDeviceIntRect& aRenderRect);
-
-  // Overlay drawing functions for OpenGL drawing
-  void DrawWindowOverlay(mozilla::layers::GLManager* aManager, LayoutDeviceIntRect aRect);
-  void MaybeDrawRoundedCorners(mozilla::layers::GLManager* aManager,
-                               const LayoutDeviceIntRect& aRect);
-  void MaybeDrawTitlebar(mozilla::layers::GLManager* aManager);
-
-  // Redraw the contents of mTitlebarCGContext on the main thread, as
-  // determined by mDirtyTitlebarRegion.
-  void UpdateTitlebarCGContext();
-
-  LayoutDeviceIntRect RectContainingTitlebarControls();
   void UpdateVibrancy(const nsTArray<ThemeGeometry>& aThemeGeometries);
   mozilla::VibrancyManager& EnsureVibrancyManager();
 
   nsIWidget* GetWidgetForListenerEvents();
 
   struct SwipeInfo {
     bool wantsSwipe;
     uint32_t allowedDirections;
@@ -643,84 +558,45 @@ class nsChildView final : public nsBaseW
   // (we get queried for it *a lot* but don't want to own it)
   nsWeakPtr mAccessible;
 #endif
 
   // Protects the view from being teared down while a composition is in
   // progress on the compositor thread.
   mozilla::Mutex mViewTearDownLock;
 
-  mozilla::Mutex mEffectsLock;
-
-  // May be accessed from any thread, protected
-  // by mEffectsLock.
-  bool mHasRoundedBottomCorners;
-  int mDevPixelCornerRadius;
-  bool mIsCoveringTitlebar;
-  bool mIsFullscreen;
-  bool mIsOpaque;
-  LayoutDeviceIntRect mTitlebarRect;
-
-  // The area of mTitlebarCGContext that needs to be redrawn during the next
-  // transaction. Accessed from any thread, protected by mEffectsLock.
-  LayoutDeviceIntRegion mUpdatedTitlebarRegion;
-  CGContextRef mTitlebarCGContext;
-
-  // Compositor thread only
-  mozilla::UniquePtr<mozilla::widget::RectTextureImage> mCornerMaskImage;
-  mozilla::UniquePtr<mozilla::widget::RectTextureImage> mTitlebarImage;
-  mozilla::UniquePtr<mozilla::widget::RectTextureImage> mBasicCompositorImage;
-
-  // Main thread + webrender only
-  mozilla::Maybe<mozilla::wr::ImageKey> mTitlebarImageKey;
-  mozilla::gfx::IntSize mTitlebarImageSize;
-
-  // The area of mTitlebarCGContext that has changed and needs to be
-  // uploaded to to mTitlebarImage. Main thread only.
-  nsIntRegion mDirtyTitlebarRegion;
-
   mozilla::ViewRegion mNonDraggableRegion;
 
   // Cached value of [mView backingScaleFactor], to avoid sending two obj-c
   // messages (respondsToSelector, backingScaleFactor) every time we need to
   // use it.
   // ** We'll need to reinitialize this if the backing resolution changes. **
   mutable CGFloat mBackingScaleFactor;
 
   bool mVisible;
   bool mDrawing;
   bool mIsDispatchPaint;  // Is a paint event being dispatched
 
   bool mPluginFocused;
 
-  // Used in BasicCompositor OMTC mode. Presents the BasicCompositor result
-  // surface to the screen using an OpenGL context.
-  // Always null if StaticPrefs::gfx_core_animation_enabled_AtStartup() is true.
-  mozilla::UniquePtr<GLPresenter> mGLPresenter;
-
   RefPtr<mozilla::layers::NativeLayerRootCA> mNativeLayerRoot;
 
   // In BasicLayers mode, this is the CoreAnimation layer that contains the
   // rendering from Gecko. It is a sublayer of mNativeLayerRoot's underlying
   // wrapper layer.
   // Lazily created by EnsureContentLayerForMainThreadPainting().
-  // Always null if StaticPrefs::gfx_core_animation_enabled_AtStartup() is false.
   RefPtr<mozilla::layers::NativeLayerCA> mContentLayer;
 
   // In BasicLayers mode, this is the invalid region of mContentLayer.
   LayoutDeviceIntRegion mContentLayerInvalidRegion;
 
   mozilla::UniquePtr<mozilla::VibrancyManager> mVibrancyManager;
   RefPtr<mozilla::SwipeTracker> mSwipeTracker;
   mozilla::UniquePtr<mozilla::SwipeEventQueue> mSwipeEventQueue;
 
-  // Only used for drawRect-based painting in popups.
-  // Always null if StaticPrefs::gfx_core_animation_enabled_AtStartup() is true.
-  RefPtr<mozilla::gfx::DrawTarget> mBackingSurface;
-
   // Coordinates the triggering of CoreAnimation transactions between the main
   // thread and the compositor thread in order to avoid glitches during window
   // resizing and window focus changes.
   struct WidgetCompositingState {
     // While mAsyncCATransactionsSuspended is true, no CoreAnimation transaction
     // should be triggered on a non-main thread, because they might race with
     // main-thread driven updates such as window shape changes, and cause glitches.
     bool mAsyncCATransactionsSuspended = false;
@@ -739,16 +615,14 @@ class nsChildView final : public nsBaseW
   // before momentum events of the pan gesture have stopped firing, so this
   // flag tells us that we shouldn't allow the remaining events to cause
   // scrolling. It is reset to false once a new gesture starts (as indicated by
   // a PANGESTURE_(MAY)START event).
   bool mCurrentPanGestureBelongsToSwipe;
 
   static uint32_t sLastInputEventCount;
 
-  void ReleaseTitlebarCGContext();
-
   // This is used by SynthesizeNativeTouchPoint to maintain state between
   // multiple synthesized points
   mozilla::UniquePtr<mozilla::MultiTouchInput> mSynthesizedTouchInput;
 };
 
 #endif  // nsChildView_h_
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -101,17 +101,16 @@
 
 #include <ApplicationServices/ApplicationServices.h>
 
 #include "GeckoProfiler.h"
 
 #include "mozilla/layers/ChromeProcessController.h"
 #include "nsLayoutUtils.h"
 #include "InputData.h"
-#include "RectTextureImage.h"
 #include "SwipeTracker.h"
 #include "VibrancyManager.h"
 #include "nsNativeThemeCocoa.h"
 #include "nsIDOMWindowUtils.h"
 #include "Units.h"
 #include "UnitTransforms.h"
 #include "mozilla/UniquePtrExtensions.h"
 
@@ -180,129 +179,44 @@ static NSMutableDictionary* sNativeKeyEv
 // set up a gecko mouse event based on a cocoa mouse event
 - (void)convertCocoaMouseWheelEvent:(NSEvent*)aMouseEvent
                        toGeckoEvent:(WidgetWheelEvent*)outWheelEvent;
 - (void)convertCocoaMouseEvent:(NSEvent*)aMouseEvent toGeckoEvent:(WidgetInputEvent*)outGeckoEvent;
 - (void)convertCocoaTabletPointerEvent:(NSEvent*)aMouseEvent
                           toGeckoEvent:(WidgetMouseEvent*)outGeckoEvent;
 - (NSMenu*)contextMenu;
 
-- (BOOL)isRectObscuredBySubview:(NSRect)inRect;
-
-- (LayoutDeviceIntRegion)nativeDirtyRegionWithBoundingRect:(NSRect)aRect;
-
-- (BOOL)hasRoundedBottomCorners;
-- (CGFloat)cornerRadius;
-- (void)clearCorners;
-
-- (void)setGLOpaque:(BOOL)aOpaque;
-
 - (void)markLayerForDisplay;
 - (CALayer*)rootCALayer;
 - (void)updateRootCALayer;
 
-// Overlay drawing functions for traditional CGContext drawing
-- (void)drawTitleString;
-- (void)maskTopCornersInContext:(CGContextRef)aContext;
-
 #ifdef ACCESSIBILITY
 - (id<mozAccessible>)accessible;
 #endif
 
 - (LayoutDeviceIntPoint)convertWindowCoordinates:(NSPoint)aPoint;
 - (LayoutDeviceIntPoint)convertWindowCoordinatesRoundDown:(NSPoint)aPoint;
 
 - (BOOL)inactiveWindowAcceptsMouseEvent:(NSEvent*)aEvent;
 - (void)updateWindowDraggableState;
 
 - (bool)beginOrEndGestureForEventPhase:(NSEvent*)aEvent;
 
 - (bool)shouldConsiderStartingSwipeFromEvent:(NSEvent*)aEvent;
 
 @end
 
-@interface NSView (NSThemeFrameCornerRadius)
-- (float)roundedCornerRadius;
-@end
-
-// Starting with 10.7 the bottom corners of all windows are rounded.
-// Unfortunately, the standard rounding that OS X applies to OpenGL views
-// does not use anti-aliasing and looks very crude. Since we want a smooth,
-// anti-aliased curve, we'll draw it ourselves.
-// Additionally, we need to turn off the OS-supplied rounding because it
-// eats into our corner's curve. We do that by overriding an NSSurface method.
-@interface NSSurface
-@end
-
-@implementation NSSurface (DontCutOffCorners)
-- (CGSRegionObj)_createRoundedBottomRegionForRect:(CGRect)rect {
-  // Create a normal rect region without rounded bottom corners.
-  CGSRegionObj region;
-  CGSNewRegionWithRect(&rect, &region);
-  return region;
-}
-@end
-
 #pragma mark -
 
 // Flips a screen coordinate from a point in the cocoa coordinate system (bottom-left rect) to a
 // point that is a "flipped" cocoa coordinate system (starts in the top-left).
 static inline void FlipCocoaScreenCoordinate(NSPoint& inPoint) {
   inPoint.y = nsCocoaUtils::FlippedScreenY(inPoint.y);
 }
 
-namespace {
-
-// Used for OpenGL drawing from the compositor thread for BasicCompositor OMTC
-// when StaticPrefs::gfx_core_animation_enabled_AtStartup() is false.
-// This was created at a time when we didn't know how to use CoreAnimation for
-// robust off-main-thread drawing.
-class GLPresenter : public GLManager {
- public:
-  static mozilla::UniquePtr<GLPresenter> CreateForWindow(nsIWidget* aWindow) {
-    // Contrary to CompositorOGL, we allow unaccelerated OpenGL contexts to be
-    // used. BasicCompositor only requires very basic GL functionality.
-    bool forWebRender = false;
-    RefPtr<GLContext> context =
-        gl::GLContextProvider::CreateForWindow(aWindow, forWebRender, false);
-    return context ? MakeUnique<GLPresenter>(context) : nullptr;
-  }
-
-  explicit GLPresenter(GLContext* aContext);
-  virtual ~GLPresenter();
-
-  virtual GLContext* gl() const override { return mGLContext; }
-  virtual ShaderProgramOGL* GetProgram(GLenum aTarget, gfx::SurfaceFormat aFormat) override {
-    MOZ_ASSERT(aTarget == LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-    MOZ_ASSERT(aFormat == gfx::SurfaceFormat::R8G8B8A8);
-    return mRGBARectProgram.get();
-  }
-  virtual const gfx::Matrix4x4& GetProjMatrix() const override { return mProjMatrix; }
-  virtual void ActivateProgram(ShaderProgramOGL* aProg) override {
-    mGLContext->fUseProgram(aProg->GetProgram());
-  }
-  virtual void BindAndDrawQuad(ShaderProgramOGL* aProg, const gfx::Rect& aLayerRect,
-                               const gfx::Rect& aTextureRect) override;
-
-  void BeginFrame(LayoutDeviceIntSize aRenderSize);
-  void EndFrame();
-
-  NSOpenGLContext* GetNSOpenGLContext() {
-    return GLContextCGL::Cast(mGLContext)->GetNSOpenGLContext();
-  }
-
- protected:
-  RefPtr<mozilla::gl::GLContext> mGLContext;
-  mozilla::UniquePtr<mozilla::layers::ShaderProgramOGL> mRGBARectProgram;
-  gfx::Matrix4x4 mProjMatrix;
-  GLuint mQuadVBO;
-};
-
-}  // unnamed namespace
-
 namespace mozilla {
 
 struct SwipeEventQueue {
   SwipeEventQueue(uint32_t aAllowedDirections, uint64_t aInputBlockId)
       : allowedDirections(aAllowedDirections), inputBlockId(aInputBlockId) {}
 
   nsTArray<PanGestureInput> queuedEvents;
   uint32_t allowedDirections;
@@ -314,77 +228,59 @@ struct SwipeEventQueue {
 #pragma mark -
 
 nsChildView::nsChildView()
     : nsBaseWidget(),
       mView(nullptr),
       mParentView(nil),
       mParentWidget(nullptr),
       mViewTearDownLock("ChildViewTearDown"),
-      mEffectsLock("WidgetEffects"),
-      mHasRoundedBottomCorners(false),
-      mDevPixelCornerRadius{0},
-      mIsCoveringTitlebar(false),
-      mIsFullscreen(false),
-      mIsOpaque(false),
-      mTitlebarCGContext(nullptr),
       mBackingScaleFactor(0.0),
       mVisible(false),
       mDrawing(false),
       mIsDispatchPaint(false),
       mPluginFocused{false},
       mCompositingState("nsChildView::mCompositingState"),
       mCurrentPanGestureBelongsToSwipe{false} {}
 
 nsChildView::~nsChildView() {
-  ReleaseTitlebarCGContext();
-
   if (mSwipeTracker) {
     mSwipeTracker->Destroy();
     mSwipeTracker = nullptr;
   }
 
   // Notify the children that we're gone.  childView->ResetParent() can change
   // our list of children while it's being iterated, so the way we iterate the
   // list must allow for this.
   for (nsIWidget* kid = mLastChild; kid;) {
     nsChildView* childView = static_cast<nsChildView*>(kid);
     kid = kid->GetPrevSibling();
     childView->ResetParent();
   }
 
   NS_WARNING_ASSERTION(mOnDestroyCalled, "nsChildView object destroyed without calling Destroy()");
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    if (mContentLayer) {
-      mNativeLayerRoot->RemoveLayer(mContentLayer);  // safe if already removed
-    }
+  if (mContentLayer) {
+    mNativeLayerRoot->RemoveLayer(mContentLayer);  // safe if already removed
   }
 
   DestroyCompositor();
 
   // An nsChildView object that was in use can be destroyed without Destroy()
   // ever being called on it.  So we also need to do a quick, safe cleanup
   // here (it's too late to just call Destroy(), which can cause crashes).
   // It's particularly important to make sure widgetDestroyed is called on our
   // mView -- this method NULLs mView's mGeckoChild, and NULL checks on
   // mGeckoChild are used throughout the ChildView class to tell if it's safe
   // to use a ChildView object.
   [mView widgetDestroyed];  // Safe if mView is nil.
   mParentWidget = nil;
   TearDownView();  // Safe if called twice.
 }
 
-void nsChildView::ReleaseTitlebarCGContext() {
-  if (mTitlebarCGContext) {
-    CGContextRelease(mTitlebarCGContext);
-    mTitlebarCGContext = nullptr;
-  }
-}
-
 nsresult nsChildView::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
                              const LayoutDeviceIntRect& aRect, nsWidgetInitData* aInitData) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   // Because the hidden window is created outside of an event loop,
   // we need to provide an autorelease pool to avoid leaking cocoa objects
   // (see bug 559075).
   nsAutoreleasePool localPool;
@@ -412,20 +308,18 @@ nsresult nsChildView::Create(nsIWidget* 
   }
 
   // create our parallel NSView and hook it up to our parent. Recall
   // that NS_NATIVE_WIDGET is the NSView.
   CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mParentView);
   NSRect r = nsCocoaUtils::DevPixelsToCocoaPoints(mBounds, scaleFactor);
   mView = [[ChildView alloc] initWithFrame:r geckoChild:this];
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    mNativeLayerRoot = NativeLayerRootCA::CreateForCALayer([mView rootCALayer]);
-    mNativeLayerRoot->SetBackingScale(scaleFactor);
-  }
+  mNativeLayerRoot = NativeLayerRootCA::CreateForCALayer([mView rootCALayer]);
+  mNativeLayerRoot->SetBackingScale(scaleFactor);
 
   // If this view was created in a Gecko view hierarchy, the initial state
   // is hidden.  If the view is attached only to a native NSView but has
   // no Gecko parent (as in embedding), the initial state is visible.
   if (mParentWidget)
     [mView setHidden:YES];
   else
     mVisible = true;
@@ -818,19 +712,17 @@ void nsChildView::BackingScaleFactorChan
     return;
   }
 
   SuspendAsyncCATransactions();
   mBackingScaleFactor = newScale;
   NSRect frame = [mView frame];
   mBounds = nsCocoaUtils::CocoaRectToGeckoRectDevPix(frame, newScale);
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    mNativeLayerRoot->SetBackingScale(mBackingScaleFactor);
-  }
+  mNativeLayerRoot->SetBackingScale(mBackingScaleFactor);
 
   if (mWidgetListener && !mWidgetListener->GetAppWindow()) {
     if (PresShell* presShell = mWidgetListener->GetPresShell()) {
       presShell->BackingScaleFactorChanged();
     }
   }
 }
 
@@ -944,20 +836,16 @@ void nsChildView::Resize(double aX, doub
 // thread.
 // To cope with this, we define a "danger zone" during which we simply avoid
 // triggering any CATransactions on a non-main thread (called "async" CATransactions
 // here). This danger zone starts at the earliest opportunity at which we know
 // about the size change, which is nsChildView::Resize, and ends at a point at
 // which we know for sure that the paint has been handled completely, which is
 // when we return to the event loop after layer display.
 void nsChildView::SuspendAsyncCATransactions() {
-  if (!StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    return;
-  }
-
   if (mUnsuspendAsyncCATransactionsRunnable) {
     mUnsuspendAsyncCATransactionsRunnable->Cancel();
     mUnsuspendAsyncCATransactionsRunnable = nullptr;
   }
 
   // Make sure that there actually will be a CATransaction on the main thread
   // during which we get a chance to schedule unsuspension. Otherwise we might
   // accidentally stay suspended indefinitely.
@@ -1287,23 +1175,19 @@ static void blinkRgn(RgnHandle rgn) {
 void nsChildView::Invalidate(const LayoutDeviceIntRect& aRect) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mView || !mVisible) return;
 
   NS_ASSERTION(GetLayerManager()->GetBackendType() != LayersBackend::LAYERS_CLIENT,
                "Shouldn't need to invalidate with accelerated OMTC layers!");
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    EnsureContentLayerForMainThreadPainting();
-    mContentLayerInvalidRegion.OrWith(aRect.Intersect(GetBounds()));
-    [mView markLayerForDisplay];
-  } else {
-    [[mView pixelHostingView] setNeedsDisplayInRect:DevPixelsToCocoaPoints(aRect)];
-  }
+  EnsureContentLayerForMainThreadPainting();
+  mContentLayerInvalidRegion.OrWith(aRect.Intersect(GetBounds()));
+  [mView markLayerForDisplay];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 bool nsChildView::WidgetTypeSupportsAcceleration() {
   // We need to enable acceleration in popups which contain remote layer
   // trees, since the remote content won't be rendered at all otherwise. This
   // causes issues with transparency and drop shadows, so it should not be
@@ -1438,60 +1322,16 @@ bool nsChildView::PaintWindowInDrawTarge
   }
   if (GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
     // We only need this so that we actually get DidPaintWindow fired
     return PaintWindow(aRegion);
   }
   return false;
 }
 
-bool nsChildView::PaintWindowInContext(CGContextRef aContext, const LayoutDeviceIntRegion& aRegion,
-                                       gfx::IntSize aSurfaceSize) {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  if (!mBackingSurface || mBackingSurface->GetSize() != aSurfaceSize) {
-    mBackingSurface = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
-        aSurfaceSize, gfx::SurfaceFormat::B8G8R8A8);
-    if (!mBackingSurface) {
-      return false;
-    }
-  }
-
-  bool painted = PaintWindowInDrawTarget(mBackingSurface, aRegion, aSurfaceSize);
-
-  uint8_t* data;
-  gfx::IntSize size;
-  int32_t stride;
-  gfx::SurfaceFormat format;
-
-  if (!mBackingSurface->LockBits(&data, &size, &stride, &format)) {
-    return false;
-  }
-
-  // Draw the backing surface onto the window.
-  CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, data, stride * size.height, NULL);
-  NSColorSpace* colorSpace = [[mView window] colorSpace];
-  CGImageRef image =
-      CGImageCreate(size.width, size.height, 8, 32, stride, [colorSpace CGColorSpace],
-                    kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst, provider, NULL,
-                    false, kCGRenderingIntentDefault);
-  CGContextSaveGState(aContext);
-  CGContextTranslateCTM(aContext, 0, size.height);
-  CGContextScaleCTM(aContext, 1, -1);
-  CGContextSetBlendMode(aContext, kCGBlendModeCopy);
-  CGContextDrawImage(aContext, CGRectMake(0, 0, size.width, size.height), image);
-  CGImageRelease(image);
-  CGDataProviderRelease(provider);
-  CGContextRestoreGState(aContext);
-
-  mBackingSurface->ReleaseBits(data);
-
-  return painted;
-}
-
 void nsChildView::EnsureContentLayerForMainThreadPainting() {
   // Ensure we have an mContentLayer of the correct size.
   // The content layer gets created on demand for BasicLayers windows. We do
   // not create it during widget creation because, for non-BasicLayers windows,
   // the compositing layer manager will create any layers it needs.
   gfx::IntSize size = GetBounds().Size().ToUnknownSize();
   if (mContentLayer && mContentLayer->GetSize() != size) {
     mNativeLayerRoot->RemoveLayer(mContentLayer);
@@ -1859,439 +1699,43 @@ void nsChildView::CreateCompositor() {
     [mView setUsingOMTCompositor:true];
   }
 }
 
 void nsChildView::ConfigureAPZCTreeManager() { nsBaseWidget::ConfigureAPZCTreeManager(); }
 
 void nsChildView::ConfigureAPZControllerThread() { nsBaseWidget::ConfigureAPZControllerThread(); }
 
-LayoutDeviceIntRect nsChildView::RectContainingTitlebarControls() {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  NSRect rect = NSZeroRect;
-
-  // If we draw the titlebar title string, set the rect to the full window
-  // width times the default titlebar height. This height does not necessarily
-  // include all the titlebar controls because we may have moved them further
-  // down, but at least it will include the whole title text.
-  BaseWindow* window = (BaseWindow*)[mView window];
-  if ([window wantsTitleDrawn] && [window isKindOfClass:[ToolbarWindow class]]) {
-    CGFloat defaultTitlebarHeight = [(ToolbarWindow*)window titlebarHeight];
-    rect = NSMakeRect(0, 0, [mView bounds].size.width, defaultTitlebarHeight);
-  }
-
-  // Add the rects of the titlebar controls.
-  for (id view in [window titlebarControls]) {
-    rect = NSUnionRect(rect, [mView convertRect:[view bounds] fromView:view]);
-  }
-  return CocoaPointsToDevPixels(rect);
-}
-
-void nsChildView::PrepareWindowEffects() {
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  bool canBeOpaque;
-  {
-    MutexAutoLock lock(mEffectsLock);
-    mHasRoundedBottomCorners = [mView hasRoundedBottomCorners];
-    CGFloat cornerRadius = [mView cornerRadius];
-    mDevPixelCornerRadius = cornerRadius * BackingScaleFactor();
-    mIsCoveringTitlebar = [mView isCoveringTitlebar];
-    NSInteger styleMask = [[mView window] styleMask];
-    bool wasFullscreen = mIsFullscreen;
-    nsCocoaWindow* windowWidget = GetAppWindowWidget();
-    mIsFullscreen =
-        (styleMask & NSFullScreenWindowMask) || (windowWidget && windowWidget->InFullScreenMode());
-
-    canBeOpaque = mIsFullscreen && wasFullscreen;
-    if (canBeOpaque && VibrancyManager::SystemSupportsVibrancy()) {
-      canBeOpaque = !EnsureVibrancyManager().HasVibrantRegions();
-    }
-    if (mIsCoveringTitlebar && !StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-      mTitlebarRect = RectContainingTitlebarControls();
-      UpdateTitlebarCGContext();
-    }
-  }
-
-  // If we've just transitioned into or out of full screen then update the opacity on our GLContext.
-  if (canBeOpaque != mIsOpaque) {
-    mIsOpaque = canBeOpaque;
-    [mView setGLOpaque:canBeOpaque];
-  }
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-
-void nsChildView::CleanupWindowEffects() {
-  mCornerMaskImage = nullptr;
-  mTitlebarImage = nullptr;
-}
-
-void nsChildView::AddWindowOverlayWebRenderCommands(layers::WebRenderBridgeChild* aWrBridge,
-                                                    wr::DisplayListBuilder& aBuilder,
-                                                    wr::IpcResourceUpdateQueue& aResources) {
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    return;
-  }
-
-  PrepareWindowEffects();
-
-  if (!mIsCoveringTitlebar || mIsFullscreen || mTitlebarRect.IsEmpty()) {
-    return;
-  }
-
-  bool needUpdate = mUpdatedTitlebarRegion.Intersects(mTitlebarRect);
-  mUpdatedTitlebarRegion.SetEmpty();
-
-  if (mTitlebarCGContext) {
-    gfx::IntSize size(CGBitmapContextGetWidth(mTitlebarCGContext),
-                      CGBitmapContextGetHeight(mTitlebarCGContext));
-    size_t stride = CGBitmapContextGetBytesPerRow(mTitlebarCGContext);
-    size_t titlebarCGContextDataLength = stride * size.height;
-    gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8;
-    Range<uint8_t> buffer(static_cast<uint8_t*>(CGBitmapContextGetData(mTitlebarCGContext)),
-                          titlebarCGContextDataLength);
-
-    if (!mTitlebarImageKey) {
-      mTitlebarImageKey = Some(aWrBridge->GetNextImageKey());
-      wr::ImageDescriptor descriptor(size, stride, format);
-      aResources.AddImage(*mTitlebarImageKey, descriptor, buffer);
-      mTitlebarImageSize = size;
-      needUpdate = false;
-    }
-
-    if (needUpdate) {
-      wr::ImageDescriptor descriptor(size, stride, format);
-      aResources.UpdateImageBuffer(*mTitlebarImageKey, descriptor, buffer);
-    }
-
-    wr::LayoutRect rect = wr::ToLayoutRect(mTitlebarRect);
-    aBuilder.PushImage(wr::LayoutRect{rect.origin, {float(size.width), float(size.height)}}, rect,
-                       true, wr::ImageRendering::Auto, *mTitlebarImageKey);
-  }
-}
-
 bool nsChildView::PreRender(WidgetRenderingContext* aContext) {
   // The lock makes sure that we don't attempt to tear down the view while
   // compositing. That would make us unable to call postRender on it when the
   // composition is done, thus keeping the GL context locked forever.
   mViewTearDownLock.Lock();
 
-  bool canComposite = PreRenderImpl(aContext);
-
-  if (!canComposite) {
-    mViewTearDownLock.Unlock();
-    return false;
-  }
-  return true;
-}
-
-bool nsChildView::PreRenderImpl(WidgetRenderingContext* aContext) {
-  UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
-  gl::GLContext* gl = manager ? manager->gl() : aContext->mGL;
-
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    return true;
-  }
-
-  if (gl) {
-    return [mView preRender:GLContextCGL::Cast(gl)->GetNSOpenGLContext()];
-  }
-
-  // BasicCompositor.
-  MOZ_RELEASE_ASSERT(mGLPresenter, "Should have been set up in InitCompositor");
-  if (![mView preRender:mGLPresenter->GetNSOpenGLContext()]) {
-    return false;
-  }
-
-  if (!mBasicCompositorImage) {
-    mBasicCompositorImage = MakeUnique<RectTextureImage>();
-  }
   return true;
 }
 
 void nsChildView::PostRender(WidgetRenderingContext* aContext) {
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    auto compositingState = mCompositingState.Lock();
-    if (compositingState->mAsyncCATransactionsSuspended) {
-      // We should not trigger a CATransactions on this thread. Instead, let the
-      // main thread take care of calling ApplyChanges at an appropriate time.
-      compositingState->mNativeLayerChangesPending = true;
-    } else {
-      // Force a CoreAnimation layer tree update from this thread.
-      [NSAnimationContext beginGrouping];
-      mNativeLayerRoot->ApplyChanges();
-      compositingState->mNativeLayerChangesPending = false;
-      [NSAnimationContext endGrouping];
-    }
+  auto compositingState = mCompositingState.Lock();
+  if (compositingState->mAsyncCATransactionsSuspended) {
+    // We should not trigger a CATransactions on this thread. Instead, let the
+    // main thread take care of calling ApplyChanges at an appropriate time.
+    compositingState->mNativeLayerChangesPending = true;
   } else {
-    UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
-    GLContext* gl = manager ? manager->gl() : aContext->mGL;
-    NSOpenGLContext* glContext =
-        gl ? GLContextCGL::Cast(gl)->GetNSOpenGLContext() : mGLPresenter->GetNSOpenGLContext();
-    [mView postRender:glContext];
+    // Force a CoreAnimation layer tree update from this thread.
+    [NSAnimationContext beginGrouping];
+    mNativeLayerRoot->ApplyChanges();
+    compositingState->mNativeLayerChangesPending = false;
+    [NSAnimationContext endGrouping];
   }
   mViewTearDownLock.Unlock();
 }
 
 RefPtr<layers::NativeLayerRoot> nsChildView::GetNativeLayerRoot() { return mNativeLayerRoot; }
 
-void nsChildView::DrawWindowOverlay(WidgetRenderingContext* aContext, LayoutDeviceIntRect aRect) {
-  mozilla::UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
-  if (manager) {
-    DrawWindowOverlay(manager.get(), aRect);
-  }
-}
-
-void nsChildView::DrawWindowOverlay(GLManager* aManager, LayoutDeviceIntRect aRect) {
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    return;
-  }
-
-  GLContext* gl = aManager->gl();
-  ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST, false);
-
-  MaybeDrawTitlebar(aManager);
-  MaybeDrawRoundedCorners(aManager, aRect);
-}
-
-static void ClearRegion(gfx::DrawTarget* aDT, LayoutDeviceIntRegion aRegion) {
-  gfxUtils::ClipToRegion(aDT, aRegion.ToUnknownRegion());
-  aDT->ClearRect(gfx::Rect(0, 0, aDT->GetSize().width, aDT->GetSize().height));
-  aDT->PopClip();
-}
-
-static CGContextRef CreateCGContext(const LayoutDeviceIntSize& aSize) {
-  CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
-  CGContextRef ctx = CGBitmapContextCreate(
-      NULL, aSize.width, aSize.height, 8 /* bitsPerComponent */, aSize.width * 4, cs,
-      kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
-  CGColorSpaceRelease(cs);
-
-  CGContextTranslateCTM(ctx, 0, aSize.height);
-  CGContextScaleCTM(ctx, 1, -1);
-  CGContextSetInterpolationQuality(ctx, kCGInterpolationLow);
-
-  return ctx;
-}
-
-static LayoutDeviceIntSize TextureSizeForSize(const LayoutDeviceIntSize& aSize) {
-  return LayoutDeviceIntSize(RoundUpPow2(aSize.width), RoundUpPow2(aSize.height));
-}
-
-// When this method is entered, mEffectsLock is already being held.
-void nsChildView::UpdateTitlebarCGContext() {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  if (mTitlebarRect.IsEmpty()) {
-    ReleaseTitlebarCGContext();
-    return;
-  }
-
-  NSRect titlebarRect = DevPixelsToCocoaPoints(mTitlebarRect);
-  NSRect dirtyRect = [mView convertRect:[(BaseWindow*)[mView window] getAndResetNativeDirtyRect]
-                               fromView:nil];
-  NSRect dirtyTitlebarRect = NSIntersectionRect(titlebarRect, dirtyRect);
-
-  LayoutDeviceIntSize texSize = TextureSizeForSize(mTitlebarRect.Size());
-  if (!mTitlebarCGContext || CGBitmapContextGetWidth(mTitlebarCGContext) != size_t(texSize.width) ||
-      CGBitmapContextGetHeight(mTitlebarCGContext) != size_t(texSize.height)) {
-    dirtyTitlebarRect = titlebarRect;
-
-    ReleaseTitlebarCGContext();
-
-    mTitlebarCGContext = CreateCGContext(texSize);
-  }
-
-  if (NSIsEmptyRect(dirtyTitlebarRect)) {
-    return;
-  }
-
-  CGContextRef ctx = mTitlebarCGContext;
-
-  CGContextSaveGState(ctx);
-
-  CGContextTranslateCTM(ctx, -mTitlebarRect.x, -mTitlebarRect.y);
-
-  double scale = BackingScaleFactor();
-  CGContextScaleCTM(ctx, scale, scale);
-
-  CGContextClipToRect(ctx, NSRectToCGRect(dirtyTitlebarRect));
-  CGContextClearRect(ctx, NSRectToCGRect(dirtyTitlebarRect));
-
-  NSGraphicsContext* oldContext = [NSGraphicsContext currentContext];
-
-  CGContextSaveGState(ctx);
-
-  BaseWindow* window = (BaseWindow*)[mView window];
-  NSView* frameView = [[window contentView] superview];
-  if (![frameView isFlipped]) {
-    CGContextTranslateCTM(ctx, 0, [frameView bounds].size.height);
-    CGContextScaleCTM(ctx, 1, -1);
-  }
-  NSGraphicsContext* context =
-      [NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:[frameView isFlipped]];
-  [NSGraphicsContext setCurrentContext:context];
-
-  // Draw the title string.
-  if ([window wantsTitleDrawn] && [frameView respondsToSelector:@selector(_drawTitleBar:)]) {
-    [frameView _drawTitleBar:[frameView bounds]];
-  }
-
-  // Draw the titlebar controls into the titlebar image.
-  for (id view in [window titlebarControls]) {
-    NSRect viewFrame = [view frame];
-    NSRect viewRect = [mView convertRect:viewFrame fromView:frameView];
-    if (!NSIntersectsRect(dirtyTitlebarRect, viewRect)) {
-      continue;
-    }
-    // All of the titlebar controls we're interested in are subclasses of
-    // NSButton.
-    if (![view isKindOfClass:[NSButton class]]) {
-      continue;
-    }
-    NSButton* button = (NSButton*)view;
-    id cellObject = [button cell];
-    if (![cellObject isKindOfClass:[NSCell class]]) {
-      continue;
-    }
-    NSCell* cell = (NSCell*)cellObject;
-
-    CGContextSaveGState(ctx);
-    CGContextTranslateCTM(ctx, viewFrame.origin.x, viewFrame.origin.y);
-
-    if ([context isFlipped] != [view isFlipped]) {
-      CGContextTranslateCTM(ctx, 0, viewFrame.size.height);
-      CGContextScaleCTM(ctx, 1, -1);
-    }
-
-    [NSGraphicsContext
-        setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:ctx
-                                                                     flipped:[view isFlipped]]];
-
-    if ([window useBrightTitlebarForeground] && !nsCocoaFeatures::OnYosemiteOrLater() &&
-        view == [window standardWindowButton:NSWindowFullScreenButton]) {
-      // Make the fullscreen button visible on dark titlebar backgrounds by
-      // drawing it into a new transparency layer and turning it white.
-      CGRect r = NSRectToCGRect([view bounds]);
-      CGContextBeginTransparencyLayerWithRect(ctx, r, nullptr);
-
-      // Draw twice for double opacity.
-      [cell drawWithFrame:[button bounds] inView:button];
-      [cell drawWithFrame:[button bounds] inView:button];
-
-      // Make it white.
-      CGContextSetBlendMode(ctx, kCGBlendModeSourceIn);
-      CGContextSetRGBFillColor(ctx, 1, 1, 1, 1);
-      CGContextFillRect(ctx, r);
-      CGContextSetBlendMode(ctx, kCGBlendModeNormal);
-
-      CGContextEndTransparencyLayer(ctx);
-    } else {
-      [cell drawWithFrame:[button bounds] inView:button];
-    }
-
-    [NSGraphicsContext setCurrentContext:context];
-    CGContextRestoreGState(ctx);
-  }
-
-  CGContextRestoreGState(ctx);
-
-  [NSGraphicsContext setCurrentContext:oldContext];
-
-  CGContextRestoreGState(ctx);
-
-  mUpdatedTitlebarRegion.OrWith(CocoaPointsToDevPixels(dirtyTitlebarRect));
-}
-
-// This method draws an overlay in the top of the window which contains the
-// titlebar controls (e.g. close, min, zoom, fullscreen) and the titlebar
-// highlight effect.
-// This is necessary because the real titlebar controls are covered by our
-// OpenGL context. Note that in terms of the NSView hierarchy, our ChildView
-// is actually below the titlebar controls - that's why hovering and clicking
-// them works as expected - but their visual representation is only drawn into
-// the normal window buffer, and the window buffer surface lies below the
-// GLContext surface. In order to make the titlebar controls visible, we have
-// to redraw them inside the OpenGL context surface.
-void nsChildView::MaybeDrawTitlebar(GLManager* aManager) {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  MutexAutoLock lock(mEffectsLock);
-  if (!mIsCoveringTitlebar || mIsFullscreen || mTitlebarRect.IsEmpty()) {
-    return;
-  }
-
-  LayoutDeviceIntRegion updatedTitlebarRegion;
-  updatedTitlebarRegion.And(mUpdatedTitlebarRegion, mTitlebarRect);
-  updatedTitlebarRegion.MoveBy(-mTitlebarRect.TopLeft());
-  mUpdatedTitlebarRegion.SetEmpty();
-
-  if (!mTitlebarImage) {
-    mTitlebarImage = MakeUnique<RectTextureImage>();
-  }
-
-  mTitlebarImage->UpdateFromCGContext(mTitlebarRect.Size(), updatedTitlebarRegion,
-                                      mTitlebarCGContext);
-
-  mTitlebarImage->Draw(aManager, mTitlebarRect.TopLeft());
-}
-
-static void DrawTopLeftCornerMask(CGContextRef aCtx, int aRadius) {
-  CGContextSetRGBFillColor(aCtx, 1.0, 1.0, 1.0, 1.0);
-  CGContextFillEllipseInRect(aCtx, CGRectMake(0, 0, aRadius * 2, aRadius * 2));
-}
-
-void nsChildView::MaybeDrawRoundedCorners(GLManager* aManager, const LayoutDeviceIntRect& aRect) {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  MutexAutoLock lock(mEffectsLock);
-
-  if (!mCornerMaskImage) {
-    mCornerMaskImage = MakeUnique<RectTextureImage>();
-  }
-
-  LayoutDeviceIntSize size(mDevPixelCornerRadius, mDevPixelCornerRadius);
-  mCornerMaskImage->UpdateIfNeeded(
-      size, LayoutDeviceIntRegion(),
-      ^(gfx::DrawTarget* drawTarget, const LayoutDeviceIntRegion& updateRegion) {
-        ClearRegion(drawTarget, updateRegion);
-        RefPtr<gfx::PathBuilder> builder = drawTarget->CreatePathBuilder();
-        builder->Arc(gfx::Point(mDevPixelCornerRadius, mDevPixelCornerRadius),
-                     mDevPixelCornerRadius, 0, 2.0f * M_PI);
-        RefPtr<gfx::Path> path = builder->Finish();
-        drawTarget->Fill(path, gfx::ColorPattern(gfx::Color(1.0, 1.0, 1.0, 1.0)),
-                         gfx::DrawOptions(1.0f, gfx::CompositionOp::OP_SOURCE));
-      });
-
-  // Use operator destination in: multiply all 4 channels with source alpha.
-  aManager->gl()->fBlendFuncSeparate(LOCAL_GL_ZERO, LOCAL_GL_SRC_ALPHA, LOCAL_GL_ZERO,
-                                     LOCAL_GL_SRC_ALPHA);
-
-  Matrix4x4 flipX = Matrix4x4::Scaling(-1, 1, 1);
-  Matrix4x4 flipY = Matrix4x4::Scaling(1, -1, 1);
-
-  if (mIsCoveringTitlebar && !mIsFullscreen) {
-    // Mask the top corners.
-    mCornerMaskImage->Draw(aManager, aRect.TopLeft());
-    mCornerMaskImage->Draw(aManager, aRect.TopRight(), flipX);
-  }
-
-  if (mHasRoundedBottomCorners && !mIsFullscreen) {
-    // Mask the bottom corners.
-    mCornerMaskImage->Draw(aManager, aRect.BottomLeft(), flipY);
-    mCornerMaskImage->Draw(aManager, aRect.BottomRight(), flipY * flipX);
-  }
-
-  // Reset blend mode.
-  aManager->gl()->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA, LOCAL_GL_ONE,
-                                     LOCAL_GL_ONE);
-}
-
 static int32_t FindTitlebarBottom(const nsTArray<nsIWidget::ThemeGeometry>& aThemeGeometries,
                                   int32_t aWindowWidth) {
   int32_t titlebarBottom = 0;
   for (auto& g : aThemeGeometries) {
     if ((g.mType == nsNativeThemeCocoa::eThemeGeometryTypeTitlebar ||
          g.mType == nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarLight ||
          g.mType == nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarDark) &&
         g.mRect.X() <= 0 && g.mRect.XMost() >= aWindowWidth && g.mRect.Y() <= 0) {
@@ -2518,84 +1962,16 @@ void nsChildView::SwipeFinished() { mSwi
 void nsChildView::UpdateBoundsFromView() {
   auto oldSize = mBounds.Size();
   mBounds = CocoaPointsToDevPixels([mView frame]);
   if (mBounds.Size() != oldSize) {
     SuspendAsyncCATransactions();
   }
 }
 
-already_AddRefed<gfx::DrawTarget> nsChildView::StartRemoteDrawingInRegion(
-    LayoutDeviceIntRegion& aInvalidRegion, BufferMode* aBufferMode) {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup(),
-                     "Not expecting calls to StartRemoteDrawingInRegion when using CoreAnimation "
-                     "because we return something non-null from GetNativeLayerRoot()");
-  MOZ_RELEASE_ASSERT(mGLPresenter);
-
-  LayoutDeviceIntRegion dirtyRegion(aInvalidRegion);
-  LayoutDeviceIntSize renderSize = mBounds.Size();
-
-  MOZ_RELEASE_ASSERT(mBasicCompositorImage, "Should have created this in PreRender.");
-  RefPtr<gfx::DrawTarget> drawTarget = mBasicCompositorImage->BeginUpdate(renderSize, dirtyRegion);
-
-  if (!drawTarget) {
-    // Composite unchanged textures.
-    DoRemoteComposition(mBounds);
-    return nullptr;
-  }
-
-  aInvalidRegion = mBasicCompositorImage->GetUpdateRegion();
-  *aBufferMode = BufferMode::BUFFER_NONE;
-
-  return drawTarget.forget();
-}
-
-void nsChildView::EndRemoteDrawing() {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup(),
-                     "Not expecting calls to EndRemoteDrawing when using CoreAnimation "
-                     "because we return something non-null from GetNativeLayerRoot()");
-
-  mBasicCompositorImage->EndUpdate();
-  DoRemoteComposition(mBounds);
-}
-
-void nsChildView::CleanupRemoteDrawing() {
-  mBasicCompositorImage = nullptr;
-  mCornerMaskImage = nullptr;
-  mTitlebarImage = nullptr;
-  mGLPresenter = nullptr;
-}
-
-bool nsChildView::InitCompositor(Compositor* aCompositor) {
-  if (!StaticPrefs::gfx_core_animation_enabled_AtStartup() &&
-      aCompositor->GetBackendType() == LayersBackend::LAYERS_BASIC) {
-    if (!mGLPresenter) {
-      mGLPresenter = GLPresenter::CreateForWindow(this);
-    }
-
-    return !!mGLPresenter;
-  }
-  return true;
-}
-
-void nsChildView::DoRemoteComposition(const LayoutDeviceIntRect& aRenderRect) {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  mGLPresenter->BeginFrame(aRenderRect.Size());
-
-  // Draw the result from the basic compositor.
-  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.get(), aRenderRect);
-
-  mGLPresenter->EndFrame();
-}
-
 @interface NonDraggableView : NSView
 @end
 
 @implementation NonDraggableView
 - (BOOL)mouseDownCanMoveWindow {
   return NO;
 }
 - (NSView*)hitTest:(NSPoint)aPoint {
@@ -2890,104 +2266,16 @@ already_AddRefed<a11y::Accessible> nsChi
   // cache the accessible in our weak ptr
   RefPtr<a11y::Accessible> acc = GetRootAccessible();
   mAccessible = do_GetWeakReference(acc.get());
 
   return acc.forget();
 }
 #endif
 
-// GLPresenter implementation
-
-GLPresenter::GLPresenter(GLContext* aContext) : mGLContext(aContext), mQuadVBO{0} {
-  mGLContext->MakeCurrent();
-  ShaderConfigOGL config;
-  config.SetTextureTarget(LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-  mRGBARectProgram =
-      MakeUnique<ShaderProgramOGL>(mGLContext, ProgramProfileOGL::GetProfileFor(config));
-
-  // Create mQuadVBO.
-  mGLContext->fGenBuffers(1, &mQuadVBO);
-  mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mQuadVBO);
-
-  // 1 quad, with the number of the quad (vertexID) encoded in w.
-  GLfloat vertices[] = {
-      0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
-      1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f,
-  };
-  HeapCopyOfStackArray<GLfloat> verticesOnHeap(vertices);
-  mGLContext->fBufferData(LOCAL_GL_ARRAY_BUFFER, verticesOnHeap.ByteLength(), verticesOnHeap.Data(),
-                          LOCAL_GL_STATIC_DRAW);
-  mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0);
-}
-
-GLPresenter::~GLPresenter() {
-  if (mQuadVBO) {
-    mGLContext->MakeCurrent();
-    mGLContext->fDeleteBuffers(1, &mQuadVBO);
-    mQuadVBO = 0;
-  }
-}
-
-void GLPresenter::BindAndDrawQuad(ShaderProgramOGL* aProgram, const gfx::Rect& aLayerRect,
-                                  const gfx::Rect& aTextureRect) {
-  mGLContext->MakeCurrent();
-
-  gfx::Rect layerRects[4];
-  gfx::Rect textureRects[4];
-
-  layerRects[0] = aLayerRect;
-  textureRects[0] = aTextureRect;
-
-  aProgram->SetLayerRects(layerRects);
-  aProgram->SetTextureRects(textureRects);
-
-  const GLuint coordAttribIndex = 0;
-
-  mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mQuadVBO);
-  mGLContext->fVertexAttribPointer(coordAttribIndex, 4, LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0,
-                                   (GLvoid*)0);
-  mGLContext->fEnableVertexAttribArray(coordAttribIndex);
-  mGLContext->fDrawArrays(LOCAL_GL_TRIANGLES, 0, 6);
-  mGLContext->fDisableVertexAttribArray(coordAttribIndex);
-}
-
-void GLPresenter::BeginFrame(LayoutDeviceIntSize aRenderSize) {
-  mGLContext->MakeCurrent();
-
-  mGLContext->fViewport(0, 0, aRenderSize.width, aRenderSize.height);
-
-  // Matrix to transform (0, 0, width, height) to viewport space (-1.0, 1.0,
-  // 2, 2) and flip the contents.
-  gfx::Matrix viewMatrix = gfx::Matrix::Translation(-1.0, 1.0);
-  viewMatrix.PreScale(2.0f / float(aRenderSize.width), 2.0f / float(aRenderSize.height));
-  viewMatrix.PreScale(1.0f, -1.0f);
-
-  gfx::Matrix4x4 matrix3d = gfx::Matrix4x4::From2D(viewMatrix);
-  matrix3d._33 = 0.0f;
-
-  // set the projection matrix for the next time the program is activated
-  mProjMatrix = matrix3d;
-
-  // Default blend function implements "OVER"
-  mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA, LOCAL_GL_ONE,
-                                 LOCAL_GL_ONE);
-  mGLContext->fEnable(LOCAL_GL_BLEND);
-
-  mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0);
-  mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
-
-  mGLContext->fEnable(LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-}
-
-void GLPresenter::EndFrame() {
-  mGLContext->SwapBuffers();
-  mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0);
-}
-
 class WidgetsReleaserRunnable final : public mozilla::Runnable {
  public:
   explicit WidgetsReleaserRunnable(nsTArray<nsCOMPtr<nsIWidget>>&& aWidgetArray)
       : mozilla::Runnable("WidgetsReleaserRunnable"), mWidgetArray(aWidgetArray) {}
 
   // Do nothing; all this runnable does is hold a reference the widgets in
   // mWidgetArray, and those references will be dropped when this runnable
   // is destroyed.
@@ -3081,17 +2369,16 @@ NSEvent* gLastDragMouseDownEvent = nil; 
     mLastKeyDownEvent = nil;
     mClickThroughMouseDownEvent = nil;
     mDragService = nullptr;
 
     mGestureState = eGestureState_None;
     mCumulativeMagnification = 0.0;
     mCumulativeRotation = 0.0;
 
-    mNeedsGLUpdate = NO;
     mIsUpdatingLayer = NO;
 
     [self setFocusRingType:NSFocusRingTypeNone];
 
 #ifdef __LP64__
     mCancelSwipeAnimation = nil;
 #endif
 
@@ -3104,17 +2391,16 @@ NSEvent* gLastDragMouseDownEvent = nil; 
     [self addSubview:mNonDraggableViewsContainer];
     [self addSubview:mVibrancyViewsContainer];
 
     mPixelHostingView = [[PixelHostingView alloc] initWithFrame:[self bounds]];
     [mPixelHostingView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
 
     [self addSubview:mPixelHostingView];
 
-    mTopLeftCornerMask = NULL;
     mLastPressureStage = 0;
   }
 
   // register for things we'll take from other applications
   [ChildView registerViewForDraggedTypes:self];
 
   [[NSNotificationCenter defaultCenter] addObserver:self
                                            selector:@selector(systemMetricsChanged)
@@ -3147,23 +2433,16 @@ NSEvent* gLastDragMouseDownEvent = nil; 
                                              object:nil];
   [[NSDistributedNotificationCenter defaultCenter]
              addObserver:self
                 selector:@selector(systemMetricsChanged)
                     name:@"AppleAquaScrollBarVariantChanged"
                   object:nil
       suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
 
-  if (!StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(_surfaceNeedsUpdate:)
-                                                 name:NSViewGlobalFrameDidChangeNotification
-                                               object:mPixelHostingView];
-  }
-
   [[NSDistributedNotificationCenter defaultCenter]
              addObserver:self
                 selector:@selector(systemMetricsChanged)
                     name:@"AppleInterfaceThemeChangedNotification"
                   object:nil
       suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
 
   return self;
@@ -3201,75 +2480,34 @@ NSEvent* gLastDragMouseDownEvent = nil; 
 - (void)installTextInputHandler:(TextInputHandler*)aHandler {
   mTextInputHandler = aHandler;
 }
 
 - (void)uninstallTextInputHandler {
   mTextInputHandler = nullptr;
 }
 
-- (bool)preRender:(NSOpenGLContext*)aGLContext {
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
-
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  if (![self window] || ([[self window] isKindOfClass:[BaseWindow class]] &&
-                         ![(BaseWindow*)[self window] isVisibleOrBeingShown] &&
-                         ![(BaseWindow*)[self window] isMiniaturized])) {
-    // Before the window is shown, our GL context's front FBO is not
-    // framebuffer complete, so we refuse to render.
-    return false;
-  }
-
-  CGLLockContext((CGLContextObj)[aGLContext CGLContextObj]);
-
-  if (!mGLContext) {
-    mGLContext = aGLContext;
-    [mGLContext retain];
-    mNeedsGLUpdate = YES;
-  }
-
-  if (mNeedsGLUpdate) {
-    [self updateGLContext];
-    mNeedsGLUpdate = NO;
-  }
-
-  return true;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
-}
-
-- (void)postRender:(NSOpenGLContext*)aGLContext {
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  CGLUnlockContext((CGLContextObj)[aGLContext CGLContextObj]);
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-
 - (NSView*)vibrancyViewsContainer {
   return mVibrancyViewsContainer;
 }
 
 - (NSView*)nonDraggableViewsContainer {
   return mNonDraggableViewsContainer;
 }
 
 - (NSView*)pixelHostingView {
   return mPixelHostingView;
 }
 
 - (void)dealloc {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
-  [mGLContext release];
   [mLastMouseDownEvent release];
   [mLastKeyDownEvent release];
   [mClickThroughMouseDownEvent release];
-  CGImageRelease(mTopLeftCornerMask);
   ChildViewMouseTracker::OnDestroyView(self);
 
   [[NSNotificationCenter defaultCenter] removeObserver:self];
   [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
   [mVibrancyViewsContainer removeFromSuperview];
   [mVibrancyViewsContainer release];
   [mNonDraggableViewsContainer removeFromSuperview];
   [mNonDraggableViewsContainer release];
@@ -3355,34 +2593,16 @@ NSEvent* gLastDragMouseDownEvent = nil; 
 - (BOOL)mouseDownCanMoveWindow {
   // Return YES so that parts of this view can be draggable. The non-draggable
   // parts will be covered by NSViews that return NO from
   // mouseDownCanMoveWindow and thus override draggability from the inside.
   // These views are assembled in nsChildView::UpdateWindowDraggingRegion.
   return YES;
 }
 
-// Only called if StaticPrefs::gfx_core_animation_enabled_AtStartup() is false.
-- (void)updateGLContext {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  [mGLContext setView:mPixelHostingView];
-  [mGLContext update];
-}
-
-- (void)_surfaceNeedsUpdate:(NSNotification*)notification {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  if (mGLContext) {
-    CGLLockContext((CGLContextObj)[mGLContext CGLContextObj]);
-    mNeedsGLUpdate = YES;
-    CGLUnlockContext((CGLContextObj)[mGLContext CGLContextObj]);
-  }
-}
-
 - (void)viewDidChangeBackingProperties {
   [super viewDidChangeBackingProperties];
   if (mGeckoChild) {
     // actually, it could be the color space that's changed,
     // but we can't tell the difference here except by retrieving
     // the backing scale factor and comparing to the old value
     mGeckoChild->BackingScaleFactorChanged();
   }
@@ -3409,282 +2629,19 @@ NSEvent* gLastDragMouseDownEvent = nil; 
   // a content process that has the displayport suppressed. If that scenario
   // arises (I'm not sure that it does) we will need to handle it gracefully.
   nsCocoaWindow* windowWidget = mGeckoChild ? mGeckoChild->GetAppWindowWidget() : nullptr;
   if (windowWidget) {
     windowWidget->NotifyLiveResizeStopped();
   }
 }
 
-- (LayoutDeviceIntRegion)nativeDirtyRegionWithBoundingRect:(NSRect)aRect {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  LayoutDeviceIntRect boundingRect = mGeckoChild->CocoaPointsToDevPixels(aRect);
-  const NSRect* rects;
-  NSInteger count;
-  [mPixelHostingView getRectsBeingDrawn:&rects count:&count];
-
-  if (count > MAX_RECTS_IN_REGION) {
-    return boundingRect;
-  }
-
-  LayoutDeviceIntRegion region;
-  for (NSInteger i = 0; i < count; ++i) {
-    region.Or(region, mGeckoChild->CocoaPointsToDevPixels(rects[i]));
-  }
-  region.And(region, boundingRect);
-  return region;
-}
-
-// The display system has told us that a portion of our view is dirty. Tell
-// gecko to paint it
-// This method is called from mPixelHostingView's drawRect handler.
-// Only called when StaticPrefs::gfx_core_animation_enabled_AtStartup() is false.
-- (void)doDrawRect:(NSRect)aRect {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  if (!NS_IsMainThread()) {
-    // In the presence of CoreAnimation, this method can sometimes be called on
-    // a non-main thread. Ignore those calls because Gecko can only react to
-    // them on the main thread.
-    return;
-  }
-
-  if (!mGeckoChild || !mGeckoChild->IsVisible()) return;
-  CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
-
-  if (mUsingOMTCompositor) {
-    // Make sure the window's "drawRect" buffer does not interfere with our
-    // OpenGL drawing's rounded corners.
-    [self clearCorners];
-    // Force a sync OMTC composite into the OpenGL context and return.
-    LayoutDeviceIntRect geckoBounds = mGeckoChild->GetBounds();
-    LayoutDeviceIntRegion region(geckoBounds);
-    mGeckoChild->PaintWindow(region);
-    return;
-  }
-
-  AUTO_PROFILER_LABEL("ChildView::drawRect", OTHER);
-
-  // The CGContext that drawRect supplies us with comes with a transform that
-  // scales one user space unit to one Cocoa point, which can consist of
-  // multiple dev pixels. But Gecko expects its supplied context to be scaled
-  // to device pixels, so we need to reverse the scaling.
-  double scale = mGeckoChild->BackingScaleFactor();
-  CGContextSaveGState(cgContext);
-  CGContextScaleCTM(cgContext, 1.0 / scale, 1.0 / scale);
-
-  NSSize viewSize = [self bounds].size;
-  gfx::IntSize backingSize =
-      gfx::IntSize::Truncate(viewSize.width * scale, viewSize.height * scale);
-  LayoutDeviceIntRegion region = [self nativeDirtyRegionWithBoundingRect:aRect];
-
-  bool painted = mGeckoChild->PaintWindowInContext(cgContext, region, backingSize);
-
-  // Undo the scale transform so that from now on the context is in
-  // CocoaPoints again.
-  CGContextRestoreGState(cgContext);
-
-  if (!painted && [mPixelHostingView isOpaque]) {
-    // Gecko refused to draw, but we've claimed to be opaque, so we have to
-    // draw something--fill with white.
-    CGContextSetRGBFillColor(cgContext, 1, 1, 1, 1);
-    CGContextFillRect(cgContext, NSRectToCGRect(aRect));
-  }
-
-  if ([self isCoveringTitlebar]) {
-    [self drawTitleString];
-    [self maskTopCornersInContext:cgContext];
-  }
-}
-
-- (BOOL)hasRoundedBottomCorners {
-  return [[self window] respondsToSelector:@selector(bottomCornerRounded)] &&
-         [[self window] bottomCornerRounded];
-}
-
-- (CGFloat)cornerRadius {
-  NSView* frameView = [[[self window] contentView] superview];
-  if (!frameView || ![frameView respondsToSelector:@selector(roundedCornerRadius)]) return 4.0f;
-  return [frameView roundedCornerRadius];
-}
-
-- (void)setGLOpaque:(BOOL)aOpaque {
-  if (mGLContext) {
-    MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-    CGLLockContext((CGLContextObj)[mGLContext CGLContextObj]);
-    // Make the context opaque for fullscreen (since it performs better), and transparent
-    // for windowed (since we need it for rounded corners), but allow overriding
-    // it to opaque for testing purposes, even if that breaks the rounded corners.
-    GLint opaque = aOpaque || StaticPrefs::gfx_compositor_glcontext_opaque();
-    [mGLContext setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
-    CGLUnlockContext((CGLContextObj)[mGLContext CGLContextObj]);
-  }
-}
-
-// If StaticPrefs::gfx_core_animation_enabled_AtStartup() is false, our "accelerated" windows are
-// NSWindows which are not CoreAnimation-backed but contain an NSView with
-// an attached NSOpenGLContext.
-// This means such windows have two WindowServer-level "surfaces" (NSSurface):
-//  (1) The window's "drawRect" contents (a main-memory backed buffer) in the
-//      back and
-//  (2) the OpenGL drawing in the front.
-// These two surfaces are composited by the window manager against our window's
-// backdrop, i.e. everything on the screen behind our window.
-// When our window has rounded corners, our OpenGL drawing respects those
-// rounded corners and will leave transparent pixels in the corners. In these
-// places the contents of the window's "drawRect" buffer can show through. So
-// we need to make sure that this buffer is transparent in the corners so that
-// the rounded corner anti-aliasing in the OpenGL context will blend directly
-// against the backdrop of the window.
-// We don't bother clearing parts of the window that are covered by opaque
-// pixels from the OpenGL context.
-- (void)clearCorners {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  CGFloat radius = [self cornerRadius];
-  CGFloat w = [self bounds].size.width, h = [self bounds].size.height;
-  [[NSColor clearColor] set];
-
-  if ([self isCoveringTitlebar]) {
-    NSRectFill(NSMakeRect(0, 0, radius, radius));
-    NSRectFill(NSMakeRect(w - radius, 0, radius, radius));
-  }
-
-  if ([self hasRoundedBottomCorners]) {
-    NSRectFill(NSMakeRect(0, h - radius, radius, radius));
-    NSRectFill(NSMakeRect(w - radius, h - radius, radius, radius));
-  }
-}
-
-// This is the analog of nsChildView::MaybeDrawRoundedCorners for CGContexts.
-// We only need to mask the top corners here because Cocoa does the masking
-// for the window's bottom corners automatically.
-- (void)maskTopCornersInContext:(CGContextRef)aContext {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  CGFloat radius = [self cornerRadius];
-  int32_t devPixelCornerRadius = mGeckoChild->CocoaPointsToDevPixels(radius);
-
-  // First make sure that mTopLeftCornerMask is set up.
-  if (!mTopLeftCornerMask || int32_t(CGImageGetWidth(mTopLeftCornerMask)) != devPixelCornerRadius) {
-    CGImageRelease(mTopLeftCornerMask);
-    CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
-    CGContextRef imgCtx =
-        CGBitmapContextCreate(NULL, devPixelCornerRadius, devPixelCornerRadius, 8,
-                              devPixelCornerRadius * 4, rgb, kCGImageAlphaPremultipliedFirst);
-    CGColorSpaceRelease(rgb);
-    DrawTopLeftCornerMask(imgCtx, devPixelCornerRadius);
-    mTopLeftCornerMask = CGBitmapContextCreateImage(imgCtx);
-    CGContextRelease(imgCtx);
-  }
-
-  // kCGBlendModeDestinationIn is the secret sauce which allows us to erase
-  // already painted pixels. It's defined as R = D * Sa: multiply all channels
-  // of the destination pixel with the alpha of the source pixel. In our case,
-  // the source is mTopLeftCornerMask.
-  CGContextSaveGState(aContext);
-  CGContextSetBlendMode(aContext, kCGBlendModeDestinationIn);
-
-  CGRect destRect = CGRectMake(0, 0, radius, radius);
-
-  // Erase the top left corner...
-  CGContextDrawImage(aContext, destRect, mTopLeftCornerMask);
-
-  // ... and the top right corner.
-  CGContextTranslateCTM(aContext, [self bounds].size.width, 0);
-  CGContextScaleCTM(aContext, -1, 1);
-  CGContextDrawImage(aContext, destRect, mTopLeftCornerMask);
-
-  CGContextRestoreGState(aContext);
-}
-
-- (void)drawTitleString {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  BaseWindow* window = (BaseWindow*)[self window];
-  if (![window wantsTitleDrawn]) {
-    return;
-  }
-
-  NSView* frameView = [[window contentView] superview];
-  if (![frameView respondsToSelector:@selector(_drawTitleBar:)]) {
-    return;
-  }
-
-  NSGraphicsContext* oldContext = [NSGraphicsContext currentContext];
-  CGContextRef ctx = (CGContextRef)[oldContext graphicsPort];
-  CGContextSaveGState(ctx);
-  if ([oldContext isFlipped] != [frameView isFlipped]) {
-    CGContextTranslateCTM(ctx, 0, [self bounds].size.height);
-    CGContextScaleCTM(ctx, 1, -1);
-  }
-  [NSGraphicsContext
-      setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:ctx
-                                                                   flipped:[frameView isFlipped]]];
-  [frameView _drawTitleBar:[frameView bounds]];
-  CGContextRestoreGState(ctx);
-  [NSGraphicsContext setCurrentContext:oldContext];
-}
-
-- (void)viewWillDraw {
-  if (!NS_IsMainThread()) {
-    // In the presence of CoreAnimation, this method can sometimes be called on
-    // a non-main thread. Ignore those calls because Gecko can only react to
-    // them on the main thread.
-    return;
-  }
-
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    // If we use CALayers for display, we will call WillPaintWindow during
-    // nsChildView::HandleMainThreadCATransaction, and not here.
-    return;
-  }
-
-  nsAutoRetainCocoaObject kungFuDeathGrip(self);
-
-  if (mGeckoChild) {
-    // The OS normally *will* draw our NSWindow, no matter what we do here.
-    // But Gecko can delete our parent widget(s) (along with mGeckoChild)
-    // while processing a paint request, which closes our NSWindow and
-    // makes the OS throw an NSInternalInconsistencyException assertion when
-    // it tries to draw it.  Sometimes the OS also aborts the browser process.
-    // So we need to retain our parent(s) here and not release it/them until
-    // the next time through the main thread's run loop.  When we do this we
-    // also need to retain and release mGeckoChild, which holds a strong
-    // reference to us.  See bug 550392.
-    nsIWidget* parent = mGeckoChild->GetParent();
-    if (parent) {
-      nsTArray<nsCOMPtr<nsIWidget>> widgetArray;
-      while (parent) {
-        widgetArray.AppendElement(parent);
-        parent = parent->GetParent();
-      }
-      widgetArray.AppendElement(mGeckoChild);
-      nsCOMPtr<nsIRunnable> releaserRunnable = new WidgetsReleaserRunnable(std::move(widgetArray));
-      NS_DispatchToMainThread(releaserRunnable);
-    }
-
-    if (mUsingOMTCompositor) {
-      if (ShadowLayerForwarder* slf = mGeckoChild->GetLayerManager()->AsShadowForwarder()) {
-        slf->WindowOverlayChanged();
-      } else if (WebRenderLayerManager* wrlm =
-                     mGeckoChild->GetLayerManager()->AsWebRenderLayerManager()) {
-        wrlm->WindowOverlayChanged();
-      }
-    }
-
-    mGeckoChild->WillPaintWindow();
-  }
-  [super viewWillDraw];
-}
-
 - (void)markLayerForDisplay {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup() && !mIsUpdatingLayer) {
+  if (!mIsUpdatingLayer) {
     // This call will cause updateRootCALayer to be called during the upcoming
     // main thread CoreAnimation transaction. It will also trigger a transaction
     // if no transaction is currently pending.
     [[mPixelHostingView layer] setNeedsDisplay];
   }
 }
 
 - (void)ensureNextCompositeIsAtomicWithMainThreadPaint {
@@ -6153,43 +5110,37 @@ nsresult nsChildView::GetSelectionAsPlai
 
 @end
 
 @implementation PixelHostingView
 
 - (id)initWithFrame:(NSRect)aRect {
   self = [super initWithFrame:aRect];
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    self.wantsLayer = YES;
-    self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
-  }
+  self.wantsLayer = YES;
+  self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
 
   return self;
 }
 
 - (BOOL)isFlipped {
   return YES;
 }
 
 - (NSView*)hitTest:(NSPoint)aPoint {
   return nil;
 }
 
 - (void)drawRect:(NSRect)aRect {
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    NS_WARNING("Unexpected call to drawRect: This view returns YES from wantsUpdateLayer, so "
-               "drawRect should not be called.");
-    return;
-  }
-  [(ChildView*)[self superview] doDrawRect:aRect];
+  NS_WARNING("Unexpected call to drawRect: This view returns YES from wantsUpdateLayer, so "
+             "drawRect should not be called.");
 }
 
 - (BOOL)wantsUpdateLayer {
-  return StaticPrefs::gfx_core_animation_enabled_AtStartup();
+  return YES;
 }
 
 - (void)updateLayer {
   [(ChildView*)[self superview] updateRootCALayer];
 }
 
 - (BOOL)wantsBestResolutionOpenGLSurface {
   return nsCocoaUtils::HiDPIEnabled() ? YES : NO;
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -89,18 +89,16 @@ typedef struct _nsCocoaWindowList {
 // content view's subviews; concretely, the ToolbarWindow implementation will
 // exclude its TitlebarGradientView from the array that is returned here.
 // In the vast majority of cases, the array will only have a single element:
 // this window's mainChildView.
 - (NSArray<NSView*>*)contentViewContents;
 
 - (ChildView*)mainChildView;
 
-- (NSArray*)titlebarControls;
-
 - (void)setWantsTitleDrawn:(BOOL)aDrawTitle;
 - (BOOL)wantsTitleDrawn;
 
 - (void)setUseBrightTitlebarForeground:(BOOL)aBrightForeground;
 - (BOOL)useBrightTitlebarForeground;
 
 - (void)disableSetNeedsDisplay;
 - (void)enableSetNeedsDisplay;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -487,21 +487,19 @@ nsresult nsCocoaWindow::CreateNativeWind
 
   if (mAlwaysOnTop) {
     [mWindow setLevel:NSFloatingWindowLevel];
   }
 
   [mWindow setContentMinSize:NSMakeSize(60, 60)];
   [mWindow disableCursorRects];
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    // Make the window use CoreAnimation from the start, so that we don't
-    // switch from a non-CA window to a CA-window in the middle.
-    [[mWindow contentView] setWantsLayer:YES];
-  }
+  // Make the window use CoreAnimation from the start, so that we don't
+  // switch from a non-CA window to a CA-window in the middle.
+  [[mWindow contentView] setWantsLayer:YES];
 
   // Make sure the window starts out not draggable by the background.
   // We will turn it on as necessary.
   [mWindow setMovableByWindowBackground:NO];
 
   [[WindowDataMap sharedWindowDataMap] ensureDataForWindow:mWindow];
   mWindowMadeHere = true;
 
@@ -2660,17 +2658,16 @@ already_AddRefed<nsIWidget> nsIWidget::C
   }
 }
 
 @end
 
 @interface NSView (FrameViewMethodSwizzling)
 - (NSPoint)FrameView__closeButtonOrigin;
 - (NSPoint)FrameView__fullScreenButtonOrigin;
-- (BOOL)FrameView__wantsFloatingTitlebar;
 - (CGFloat)FrameView__titlebarHeight;
 @end
 
 @implementation NSView (FrameViewMethodSwizzling)
 
 - (NSPoint)FrameView__closeButtonOrigin {
   NSPoint defaultPosition = [self FrameView__closeButtonOrigin];
   if ([[self window] isKindOfClass:[ToolbarWindow class]]) {
@@ -2683,20 +2680,16 @@ already_AddRefed<nsIWidget> nsIWidget::C
   NSPoint defaultPosition = [self FrameView__fullScreenButtonOrigin];
   if ([[self window] isKindOfClass:[ToolbarWindow class]]) {
     return
         [(ToolbarWindow*)[self window] fullScreenButtonPositionWithDefaultPosition:defaultPosition];
   }
   return defaultPosition;
 }
 
-- (BOOL)FrameView__wantsFloatingTitlebar {
-  return NO;
-}
-
 - (CGFloat)FrameView__titlebarHeight {
   CGFloat height = [self FrameView__titlebarHeight];
   if ([[self window] isKindOfClass:[ToolbarWindow class]]) {
     // Make sure that the titlebar height includes our shifted buttons.
     // The following coordinates are in window space, with the origin being at the bottom left
     // corner of the window.
     ToolbarWindow* win = (ToolbarWindow*)[self window];
     CGFloat frameHeight = [self frame].size.height;
@@ -2765,35 +2758,30 @@ static NSMutableSet* gSwizzledFrameViewC
 @implementation BaseWindow
 
 // The frame of a window is implemented using undocumented NSView subclasses.
 // We offset the window buttons by overriding the methods _closeButtonOrigin
 // and _fullScreenButtonOrigin on these frame view classes. The class which is
 // used for a window is determined in the window's frameViewClassForStyleMask:
 // method, so this is where we make sure that we have swizzled the method on
 // all encountered classes.
-// We also override the _wantsFloatingTitlebar method to return NO in order to
-// avoid some glitches in the titlebar that are caused by the way we mess with
-// the window.
 + (Class)frameViewClassForStyleMask:(NSUInteger)styleMask {
   Class frameViewClass = [super frameViewClassForStyleMask:styleMask];
 
   if (!gSwizzledFrameViewClasses) {
     gSwizzledFrameViewClasses = [[NSMutableSet setWithCapacity:3] retain];
     if (!gSwizzledFrameViewClasses) {
       return frameViewClass;
     }
   }
 
   static IMP our_closeButtonOrigin =
       class_getMethodImplementation([NSView class], @selector(FrameView__closeButtonOrigin));
   static IMP our_fullScreenButtonOrigin =
       class_getMethodImplementation([NSView class], @selector(FrameView__fullScreenButtonOrigin));
-  static IMP our_wantsFloatingTitlebar =
-      class_getMethodImplementation([NSView class], @selector(FrameView__wantsFloatingTitlebar));
   static IMP our_titlebarHeight =
       class_getMethodImplementation([NSView class], @selector(FrameView__titlebarHeight));
 
   if (![gSwizzledFrameViewClasses containsObject:frameViewClass]) {
     // Either of these methods might be implemented in both a subclass of
     // NSFrameView and one of its own subclasses.  Which means that if we
     // aren't careful we might end up swizzling the same method twice.
     // Since method swizzling involves swapping pointers, this would break
@@ -2806,35 +2794,22 @@ static NSMutableSet* gSwizzledFrameViewC
     }
     IMP _fullScreenButtonOrigin =
         class_getMethodImplementation(frameViewClass, @selector(_fullScreenButtonOrigin));
     if (_fullScreenButtonOrigin && _fullScreenButtonOrigin != our_fullScreenButtonOrigin) {
       nsToolkit::SwizzleMethods(frameViewClass, @selector(_fullScreenButtonOrigin),
                                 @selector(FrameView__fullScreenButtonOrigin));
     }
 
-    if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-      // Override _titlebarHeight so that the floating titlebar doesn't clip the bottom of the
-      // window buttons which we move down with our override of _closeButtonOrigin.
-      IMP _titlebarHeight =
-          class_getMethodImplementation(frameViewClass, @selector(_titlebarHeight));
-      if (_titlebarHeight && _titlebarHeight != our_titlebarHeight) {
-        nsToolkit::SwizzleMethods(frameViewClass, @selector(_titlebarHeight),
-                                  @selector(FrameView__titlebarHeight));
-      }
-    } else {
-      // If CoreAnimation is not enabled, override the _wantsFloatingTitlebar method to return NO,
-      // in order to avoid titlebar glitches when in that configuration. These glitches do not
-      // appear when CoreAnimation is enabled.
-      IMP _wantsFloatingTitlebar =
-          class_getMethodImplementation(frameViewClass, @selector(_wantsFloatingTitlebar));
-      if (_wantsFloatingTitlebar && _wantsFloatingTitlebar != our_wantsFloatingTitlebar) {
-        nsToolkit::SwizzleMethods(frameViewClass, @selector(_wantsFloatingTitlebar),
-                                  @selector(FrameView__wantsFloatingTitlebar));
-      }
+    // Override _titlebarHeight so that the floating titlebar doesn't clip the bottom of the
+    // window buttons which we move down with our override of _closeButtonOrigin.
+    IMP _titlebarHeight = class_getMethodImplementation(frameViewClass, @selector(_titlebarHeight));
+    if (_titlebarHeight && _titlebarHeight != our_titlebarHeight) {
+      nsToolkit::SwizzleMethods(frameViewClass, @selector(_titlebarHeight),
+                                @selector(FrameView__titlebarHeight));
     }
 
     [gSwizzledFrameViewClasses addObject:frameViewClass];
   }
 
   return frameViewClass;
 }
 
@@ -2899,19 +2874,17 @@ static NSImage* GetMenuMaskImage() {
     if ([effectView respondsToSelector:@selector(setMaskImage:)]) {
       [effectView setMaskImage:GetMenuMaskImage()];
     }
     [self swapOutChildViewWrapper:effectView];
     [effectView release];
   } else if (mUseMenuStyle && !aValue) {
     // Turn off rounded corner masking.
     NSView* wrapper = [[NSView alloc] initWithFrame:NSZeroRect];
-    if (StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-      [wrapper setWantsLayer:YES];
-    }
+    [wrapper setWantsLayer:YES];
     [self swapOutChildViewWrapper:wrapper];
     [wrapper release];
   }
   mUseMenuStyle = aValue;
 }
 
 - (NSTouchBar*)makeTouchBar {
   mTouchBar = [[nsTouchBar alloc] init];
@@ -3122,26 +3095,16 @@ static const NSString* kStateWantsTitleD
 // Possibly move the titlebar buttons.
 - (void)reflowTitlebarElements {
   NSView* frameView = [[self contentView] superview];
   if ([frameView respondsToSelector:@selector(_tileTitlebarAndRedisplay:)]) {
     [frameView _tileTitlebarAndRedisplay:NO];
   }
 }
 
-- (NSArray*)titlebarControls {
-  MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());
-
-  // Return all subviews of the frameView which are not the content view.
-  NSView* frameView = [[self contentView] superview];
-  NSMutableArray* array = [[[frameView subviews] mutableCopy] autorelease];
-  [array removeObject:[self contentView]];
-  return array;
-}
-
 - (BOOL)respondsToSelector:(SEL)aSelector {
   // Claim the window doesn't respond to this so that the system
   // doesn't steal keyboard equivalents for it. Bug 613710.
   if (aSelector == @selector(cancelOperation:)) {
     return NO;
   }
 
   return [super respondsToSelector:aSelector];
@@ -3216,47 +3179,16 @@ static const NSString* kStateWantsTitleD
 
 @implementation TitlebarGradientView
 
 - (void)drawRect:(NSRect)aRect {
   CGContextRef ctx = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
   ToolbarWindow* window = (ToolbarWindow*)[self window];
   nsNativeThemeCocoa::DrawNativeTitlebar(ctx, NSRectToCGRect([self bounds]),
                                          [window unifiedToolbarHeight], [window isMainWindow], NO);
-
-  if (!StaticPrefs::gfx_core_animation_enabled_AtStartup()) {
-    // The following is only necessary when we're not using CoreAnimation for
-    // the window: We need to mask our drawing to the rounded top corners of the
-    // window, and we need to draw the title string on top. That's because, if
-    // CoreAnimation isn't used, the title string is drawn as part of the frame
-    // view and this view covers that drawing up.
-    // In a CoreAnimation-driven window, Cocoa will draw the title string in a
-    // separate NSView which sits on top of the window's content view, and we
-    // don't need the code below. It will also clip this view's drawing as part
-    // of the rounded corner clipping on the root CALayer of the window.
-
-    NSView* frameView = [[[self window] contentView] superview];
-    if (!frameView || ![frameView respondsToSelector:@selector(_maskCorners:clipRect:)] ||
-        ![frameView respondsToSelector:@selector(_drawTitleStringInClip:)]) {
-      return;
-    }
-
-    NSPoint offsetToFrameView = [self convertPoint:NSZeroPoint toView:frameView];
-    NSRect clipRect = {offsetToFrameView, [self bounds].size};
-
-    // Both this view and frameView return NO from isFlipped. Switch into
-    // frameView's coordinate system using a translation by the offset.
-    CGContextSaveGState(ctx);
-    CGContextTranslateCTM(ctx, -offsetToFrameView.x, -offsetToFrameView.y);
-
-    [frameView _maskCorners:2 clipRect:clipRect];
-    [frameView _drawTitleStringInClip:clipRect];
-
-    CGContextRestoreGState(ctx);
-  }
 }
 
 - (BOOL)isOpaque {
   return YES;
 }
 
 - (BOOL)mouseDownCanMoveWindow {
   return YES;
@@ -3316,17 +3248,17 @@ static const NSString* kStateWantsTitleD
                     defer:(BOOL)aFlag {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   // We treat aChildViewRect as the rectangle that the window's main ChildView
   // should be sized to. Get the right frameRect for the requested child view
   // rect.
   NSRect frameRect = [NSWindow frameRectForContentRect:aChildViewRect styleMask:aStyle];
 
-  if (StaticPrefs::gfx_core_animation_enabled_AtStartup() && nsCocoaFeatures::OnYosemiteOrLater()) {
+  if (nsCocoaFeatures::OnYosemiteOrLater()) {
     // Always size the content view to the full frame size of the window.
     // We cannot use this window mask on 10.9, because it was added in 10.10.
     // We also cannot use it when our CoreAnimation pref is disabled: This flag forces CoreAnimation
     // on for the entire window, which causes glitches in combination with our non-CoreAnimation
     // drawing. (Specifically, on macOS versions up until at least 10.14.0, layer-backed
     // NSOpenGLViews have extremely glitchy resizing behavior.)
     aStyle |= NSFullSizeContentViewWindowMask;
   }