Backed out 8 changesets (bug 914437, bug 886999, bug 890997, bug 923114, bug 923133) for suspicion of causing frequent OSX mochitest-2 timeouts on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 09 Oct 2013 14:33:01 -0400
changeset 164085 3eefb8a63b65e1a65d49dc59c528832059809b94
parent 164084 036ac2eefb65ed70d8f0b68774bcc3ad034615f3
child 164086 541e79e84ce97fe041ab94a885d632c78f8f1d24
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs914437, 886999, 890997, 923114, 923133
milestone27.0a1
backs oute934fda2488744ddb8ac6b118d8fa904a352e9b6
058c2432bff505b0c22c5f4e42af6ad6cb137c06
34d9056bf553afaefefd38f36076fc3046f19bd9
3f053c13cf4ea3abf56cd194968a6319ac763416
1f436fd67cdb1d7fffd11a829222a99b09a3bb5b
7c914b3e8d273049ee1c556a77d70126e9889024
e6fdf5fd28c55520cd24f8ea00e89968e920e0a2
b0700255080ccb48a7e6c3047a4f7d144d808e4c
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
Backed out 8 changesets (bug 914437, bug 886999, bug 890997, bug 923114, bug 923133) for suspicion of causing frequent OSX mochitest-2 timeouts on a CLOSED TREE. Backed out changeset e934fda24887 (bug 890997) Backed out changeset 058c2432bff5 (bug 886999) Backed out changeset 34d9056bf553 (bug 886999) Backed out changeset 3f053c13cf4e (bug 914437) Backed out changeset 1f436fd67cdb (bug 886999) Backed out changeset 7c914b3e8d27 (bug 923133) Backed out changeset e6fdf5fd28c5 (bug 923114) Backed out changeset b0700255080c (bug 914437)
gfx/gl/GLContextProviderCGL.mm
gfx/layers/composite/LayerManagerComposite.cpp
gfx/thebes/gfxPlatformMac.cpp
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/nsIWidget.h
widget/xpwidgets/nsBaseWidget.h
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -98,26 +98,18 @@ public:
     {
         SetProfileVersion(ContextProfile::OpenGLCompatibility, 210);
     }
 
     ~GLContextCGL()
     {
         MarkDestroyed();
 
-        if (mContext) {
-            if ([NSOpenGLContext currentContext] == mContext) {
-                // Clear the current context before releasing. If we don't do
-                // this, the next time we call [NSOpenGLContext currentContext],
-                // "invalid context" will be printed to the console.
-                [NSOpenGLContext clearCurrentContext];
-            }
+        if (mContext)
             [mContext release];
-        }
-
     }
 
     GLContextType GetContextType() {
         return ContextTypeCGL;
     }
 
     bool Init()
     {
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -321,19 +321,17 @@ LayerManagerComposite::Render()
 
   if (mComposer2D && mComposer2D->TryRender(mRoot, mWorldMatrix)) {
     mCompositor->EndFrameForExternalComposition(mWorldMatrix);
     return;
   }
 
   {
     PROFILER_LABEL("LayerManagerComposite", "PreRender");
-    if (!mCompositor->GetWidget()->PreRender(this)) {
-      return;
-    }
+    mCompositor->GetWidget()->PreRender(this);
   }
 
   nsIntRect clipRect;
   Rect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
   Rect actualBounds;
   if (mRoot->GetClipRect()) {
     clipRect = *mRoot->GetClipRect();
     WorldTransformRect(clipRect);
@@ -341,17 +339,16 @@ LayerManagerComposite::Render()
     mCompositor->BeginFrame(&rect, mWorldMatrix, bounds, nullptr, &actualBounds);
   } else {
     gfx::Rect rect;
     mCompositor->BeginFrame(nullptr, mWorldMatrix, bounds, &rect, &actualBounds);
     clipRect = nsIntRect(rect.x, rect.y, rect.width, rect.height);
   }
 
   if (actualBounds.IsEmpty()) {
-    mCompositor->GetWidget()->PostRender(this);
     return;
   }
 
   // Allow widget to render a custom background.
   mCompositor->SaveState();
   mCompositor->GetWidget()->DrawWindowUnderlay(this, nsIntRect(actualBounds.x,
                                                                actualBounds.y,
                                                                actualBounds.width,
@@ -371,18 +368,16 @@ LayerManagerComposite::Render()
 
   // Debugging
   RenderDebugOverlay(actualBounds);
 
   {
     PROFILER_LABEL("LayerManagerComposite", "EndFrame");
     mCompositor->EndFrame();
   }
-
-  mCompositor->GetWidget()->PostRender(this);
 }
 
 void
 LayerManagerComposite::SetWorldTransform(const gfxMatrix& aMatrix)
 {
   NS_ASSERTION(aMatrix.PreservesAxisAlignedRectangles(),
                "SetWorldTransform only accepts matrices that satisfy PreservesAxisAlignedRectangles");
   NS_ASSERTION(!aMatrix.HasNonIntegerScale(),
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -424,17 +424,22 @@ gfxPlatformMac::UseAcceleratedCanvas()
 {
   // Lion or later is required
   return OSXVersion() >= 0x1070 && Preferences::GetBool("gfx.canvas.azure.accelerated", false);
 }
 
 bool
 gfxPlatformMac::SupportsOffMainThreadCompositing()
 {
-  return true;
+  // 10.6.X has crashes on tinderbox with OMTC, so disable it
+  // for now.
+  if (OSXVersion() >= 0x1070) {
+    return true;
+  }
+  return GetPrefLayersOffMainThreadCompositionForceEnabled();
 }
 
 qcms_profile *
 gfxPlatformMac::GetPlatformCMSOutputProfile()
 {
     CGColorSpaceRef cspace = ::CGDisplayCopyColorSpace(::CGMainDisplayID());
     if (!cspace) {
         cspace = ::CGColorSpaceCreateDeviceRGB();
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -328,28 +328,28 @@ enum {
 - (void)handleMouseMoved:(NSEvent*)aEvent;
 
 - (void)updateWindowDraggableStateOnMouseMove:(NSEvent*)theEvent;
 
 - (void)sendMouseEnterOrExitEvent:(NSEvent*)aEvent
                             enter:(BOOL)aEnter
                              type:(mozilla::WidgetMouseEvent::exitType)aType;
 
-- (void)updateGLContext;
-- (void)_surfaceNeedsUpdate:(NSNotification*)notification;
+- (void)update;
+- (void)lockFocus;
+- (void) _surfaceNeedsUpdate:(NSNotification*)notification;
 
 - (BOOL)isPluginView;
 
 // Are we processing an NSLeftMouseDown event that will fail to click through?
 // If so, we shouldn't focus or unfocus a plugin.
 - (BOOL)isInFailingLeftClickThrough;
 
 - (void)setGLContext:(NSOpenGLContext *)aGLContext;
-- (bool)preRender:(NSOpenGLContext *)aGLContext;
-- (void)postRender:(NSOpenGLContext *)aGLContext;
+- (void)preRender:(NSOpenGLContext *)aGLContext;
 
 - (BOOL)isCoveringTitlebar;
 
 // Simple gestures support
 //
 // XXX - The swipeWithEvent, beginGestureWithEvent, magnifyWithEvent,
 // rotateWithEvent, and endGestureWithEvent methods are part of a
 // PRIVATE interface exported by nsResponder and reverse-engineering
@@ -545,18 +545,17 @@ public:
 #ifdef ACCESSIBILITY
   already_AddRefed<mozilla::a11y::Accessible> GetDocumentAccessible();
 #endif
 
   virtual void CreateCompositor();
   virtual gfxASurface* GetThebesSurface();
   virtual void PrepareWindowEffects() MOZ_OVERRIDE;
   virtual void CleanupWindowEffects() MOZ_OVERRIDE;
-  virtual bool PreRender(LayerManager* aManager) MOZ_OVERRIDE;
-  virtual void PostRender(LayerManager* aManager) MOZ_OVERRIDE;
+  virtual void PreRender(LayerManager* aManager) MOZ_OVERRIDE;
   virtual void DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) MOZ_OVERRIDE;
 
   virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries);
 
   void              HidePlugin();
   void              UpdatePluginPort();
 
   void              ResetParent();
@@ -648,20 +647,16 @@ protected:
   // weak ref to this childview's associated mozAccessible for speed reasons 
   // (we get queried for it *a lot* but don't want to own it)
   nsWeakPtr             mAccessible;
 #endif
 
 
   nsRefPtr<gfxASurface> mTempThebesSurface;
 
-  // 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 mShowsResizeIndicator;
   nsIntRect mResizeIndicatorRect;
   bool mHasRoundedBottomCorners;
   int mDevPixelCornerRadius;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -363,17 +363,16 @@ protected:
 } // unnamed namespace
 
 #pragma mark -
 
 nsChildView::nsChildView() : nsBaseWidget()
 , mView(nullptr)
 , mParentView(nullptr)
 , mParentWidget(nullptr)
-, mViewTearDownLock("ChildViewTearDown")
 , mEffectsLock("WidgetEffects")
 , mShowsResizeIndicator(false)
 , mHasRoundedBottomCorners(false)
 , mIsCoveringTitlebar(false)
 , mBackingScaleFactor(0.0)
 , mVisible(false)
 , mDrawing(false)
 , mPluginDrawing(false)
@@ -571,20 +570,16 @@ nsChildView::GetXULWindowWidget()
   }
   return nullptr;
 }
 
 NS_IMETHODIMP nsChildView::Destroy()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  // Make sure that no composition is in progress while disconnecting
-  // ourselves from the view.
-  MutexAutoLock lock(mViewTearDownLock);
-
   if (mOnDestroyCalled)
     return NS_OK;
   mOnDestroyCalled = true;
 
   [mView widgetDestroyed];
 
   nsBaseWidget::Destroy();
 
@@ -1961,16 +1956,28 @@ NSView<mozView>* nsChildView::GetEditorV
 
 #pragma mark -
 
 void
 nsChildView::CreateCompositor()
 {
   nsBaseWidget::CreateCompositor();
   if (mCompositorChild) {
+    LayerManagerComposite *manager =
+      compositor::GetLayerManager(mCompositorParent);
+    Compositor *compositor = manager->GetCompositor();
+
+    ClientLayerManager *clientManager = static_cast<ClientLayerManager*>(GetLayerManager());
+    if (clientManager->GetCompositorBackendType() == LAYERS_OPENGL) {
+      CompositorOGL *compositorOGL = static_cast<CompositorOGL*>(compositor);
+
+      NSOpenGLContext *glContext = (NSOpenGLContext *)compositorOGL->gl()->GetNativeData(GLContext::NativeGLContext);
+
+      [(ChildView *)mView setGLContext:glContext];
+    }
     [(ChildView *)mView setUsingOMTCompositor:true];
   }
 }
 
 gfxASurface*
 nsChildView::GetThebesSurface()
 {
   if (!mTempThebesSurface) {
@@ -2024,48 +2031,25 @@ nsChildView::PrepareWindowEffects()
 void
 nsChildView::CleanupWindowEffects()
 {
   mResizerImage = nullptr;
   mCornerMaskImage = nullptr;
   mTitlebarImage = nullptr;
 }
 
-bool
+void
 nsChildView::PreRender(LayerManager* aManager)
 {
   nsAutoPtr<GLManager> manager(GLManager::CreateGLManager(aManager));
   if (!manager) {
-    return true;
-  }
-
-  // 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();
-
-  NSOpenGLContext *glContext = (NSOpenGLContext *)manager->gl()->GetNativeData(GLContext::NativeGLContext);
-
-  if (![(ChildView*)mView preRender:glContext]) {
-    mViewTearDownLock.Unlock();
-    return false;
-  }
-  return true;
-}
-
-void
-nsChildView::PostRender(LayerManager* aManager)
-{
-  nsAutoPtr<GLManager> manager(GLManager::CreateGLManager(aManager));
-  if (!manager) {
     return;
   }
   NSOpenGLContext *glContext = (NSOpenGLContext *)manager->gl()->GetNativeData(GLContext::NativeGLContext);
-  [(ChildView*)mView postRender:glContext];
-  mViewTearDownLock.Unlock();
+  [(ChildView*)mView preRender:glContext];
 }
 
 void
 nsChildView::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect)
 {
   nsAutoPtr<GLManager> manager(GLManager::CreateGLManager(aManager));
   if (manager) {
     DrawWindowOverlay(manager, aRect);
@@ -2450,31 +2434,27 @@ nsChildView::CleanupRemoteDrawing()
   mResizerImage = nullptr;
   mTitlebarImage = nullptr;
   mGLPresenter = nullptr;
 }
 
 void
 nsChildView::DoRemoteComposition(const nsIntRect& aRenderRect)
 {
-  if (![(ChildView*)mView preRender:mGLPresenter->GetNSOpenGLContext()]) {
-    return;
-  }
+  [(ChildView*)mView preRender:mGLPresenter->GetNSOpenGLContext()];
   mGLPresenter->BeginFrame(aRenderRect.Size());
 
   // Draw the result from the basic compositor.
   mBasicCompositorImage->Draw(mGLPresenter, nsIntPoint(0, 0));
 
   // DrawWindowOverlay doesn't do anything for non-GL, so it didn't paint
   // anything during the basic compositor transaction. Draw the overlay now.
   DrawWindowOverlay(mGLPresenter, aRenderRect);
 
   mGLPresenter->EndFrame();
-
-  [(ChildView*)mView postRender:mGLPresenter->GetNSOpenGLContext()];
 }
 
 #ifdef ACCESSIBILITY
 already_AddRefed<a11y::Accessible>
 nsChildView::GetDocumentAccessible()
 {
   if (!mozilla::a11y::ShouldA11yBeEnabled())
     return nullptr;
@@ -2879,60 +2859,41 @@ NSEvent* gLastDragMouseDownEvent = nil;
 // again.
 // This can cause a flash in new windows - bug 631339 - but it's very hard to
 // fix that while maintaining this workaround.
 - (void)forceRefreshOpenGL
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   [mGLContext clearDrawable];
-  [self updateGLContext];
+  [mGLContext setView:self];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (void)setGLContext:(NSOpenGLContext *)aGLContext
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   mGLContext = aGLContext;
   [mGLContext retain];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
-- (bool)preRender:(NSOpenGLContext *)aGLContext
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
-
-  if (![self window] ||
-      ([[self window] isKindOfClass:[BaseWindow class]] &&
-       ![(BaseWindow*)[self window] isVisibleOrBeingShown])) {
-    // Before the window is shown, our GL context's front FBO is not
-    // framebuffer complete, so we refuse to render.
-    return false;
-  }
+-(void)preRender:(NSOpenGLContext *)aGLContext
+{
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mGLContext) {
     [self setGLContext:aGLContext];
-    [self updateGLContext];
-  }
-
-  CGLLockContext((CGLContextObj)[aGLContext CGLContextObj]);
-
-  return true;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
-}
-
-- (void)postRender:(NSOpenGLContext *)aGLContext
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  CGLUnlockContext((CGLContextObj)[aGLContext CGLContextObj]);
+  }
+
+  [aGLContext setView:self];
+  [aGLContext update];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (void)dealloc
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
@@ -3256,29 +3217,43 @@ NSEvent* gLastDragMouseDownEvent = nil;
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (BOOL)mouseDownCanMoveWindow
 {
   return [[self window] isMovableByWindowBackground];
 }
 
--(void)updateGLContext
+- (void)lockFocus
+{
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
+
+  [super lockFocus];
+
+  if (mGLContext) {
+    if ([mGLContext view] != self) {
+      [mGLContext setView:self];
+    }
+
+    [mGLContext makeCurrentContext];
+  }
+
+  NS_OBJC_END_TRY_ABORT_BLOCK;
+}
+
+-(void)update
 {
   if (mGLContext) {
-    CGLLockContext((CGLContextObj)[mGLContext CGLContextObj]);
-    [mGLContext setView:self];
     [mGLContext update];
-    CGLUnlockContext((CGLContextObj)[mGLContext CGLContextObj]);
-  }
-}
-
-- (void)_surfaceNeedsUpdate:(NSNotification*)notification
-{
-   [self updateGLContext];
+  }
+}
+
+- (void) _surfaceNeedsUpdate:(NSNotification*)notification
+{
+   [self update];
 }
 
 - (BOOL)wantsBestResolutionOpenGLSurface
 {
   return nsCocoaUtils::HiDPIEnabled() ? YES : NO;
 }
 
 - (void)viewDidChangeBackingProperties
@@ -3481,17 +3456,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
   return mGeckoChild->GetLayerManager(nullptr)->GetBackendType() == mozilla::layers::LAYERS_OPENGL;
 }
 
 - (BOOL)isUsingOpenGL
 {
   if (!mGeckoChild || ![self window])
     return NO;
 
-  return mGLContext || mUsingOMTCompositor || [self isUsingMainThreadOpenGL];
+  return mGLContext || [self isUsingMainThreadOpenGL];
 }
 
 - (void)drawUsingOpenGL
 {
   PROFILER_LABEL("widget", "ChildView::drawUsingOpenGL");
 
   if (![self isUsingOpenGL] || !mGeckoChild->IsVisible())
     return;
@@ -3504,18 +3479,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   if ([self isUsingMainThreadOpenGL]) {
     LayerManagerOGL *manager = static_cast<LayerManagerOGL*>(mGeckoChild->GetLayerManager(nullptr));
     manager->SetClippingRegion(region);
     NSOpenGLContext *glContext = (NSOpenGLContext *)manager->GetNSOpenGLContext();
 
     if (!mGLContext) {
       [self setGLContext:glContext];
-      [self updateGLContext];
     }
+
+    [glContext setView:self];
+    [glContext update];
   }
 
   mGeckoChild->PaintWindow(region);
 
   // Force OpenGL to refresh the very first time we draw. This works around a
   // Mac OS X bug that stops windows updating on OS X when we use OpenGL.
   if (!mDidForceRefreshOpenGL) {
     [self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -71,18 +71,16 @@ typedef struct _nsCocoaWindowList {
   BOOL mScheduledShadowInvalidation;
 
   // DPI cache. Getting the physical screen size (CGDisplayScreenSize)
   // is ridiculously slow, so we cache it in the toplevel window for all
   // descendants to use.
   float mDPI;
 
   NSTrackingArea* mTrackingArea;
-
-  BOOL mBeingShown;
 }
 
 - (void)importState:(NSDictionary*)aState;
 - (NSMutableDictionary*)exportState;
 - (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
 - (BOOL)drawsContentsIntoWindowFrame;
 - (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
 - (NSColor*)titlebarColorForActiveWindow:(BOOL)aActive;
@@ -92,18 +90,16 @@ typedef struct _nsCocoaWindowList {
 - (float)getDPI;
 
 - (void)mouseEntered:(NSEvent*)aEvent;
 - (void)mouseExited:(NSEvent*)aEvent;
 - (void)mouseMoved:(NSEvent*)aEvent;
 - (void)updateTrackingArea;
 - (NSView*)trackingAreaView;
 
-- (BOOL)isVisibleOrBeingShown;
-
 - (ChildView*)mainChildView;
 
 - (NSArray*)titlebarControls;
 
 @end
 
 @interface NSWindow (Undocumented)
 
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -30,17 +30,16 @@
 #include "nsCocoaFeatures.h"
 #include "nsIScreenManager.h"
 #include "nsIWidgetListener.h"
 #include "nsIPresShell.h"
 
 #include "gfxPlatform.h"
 #include "qcms.h"
 
-#include "mozilla/AutoRestore.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/Preferences.h"
 #include <algorithm>
 
 namespace mozilla {
 namespace layers {
 class LayerManager;
 }
@@ -2514,41 +2513,21 @@ GetDPI(NSWindow* aWindow)
   mDrawsIntoWindowFrame = NO;
   [super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
   mState = nil;
   mActiveTitlebarColor = nil;
   mInactiveTitlebarColor = nil;
   mScheduledShadowInvalidation = NO;
   mDPI = GetDPI(self);
   mTrackingArea = nil;
-  mBeingShown = NO;
   [self updateTrackingArea];
 
   return self;
 }
 
-- (BOOL)isVisibleOrBeingShown
-{
-  return [super isVisible] || mBeingShown;
-}
-
-- (void)orderFront:(id)sender
-{
-  AutoRestore<BOOL> saveBeingShown(mBeingShown);
-  mBeingShown = YES;
-  [super orderFront:sender];
-}
-
-- (void)makeKeyAndOrderFront:(id)sender
-{
-  AutoRestore<BOOL> saveBeingShown(mBeingShown);
-  mBeingShown = YES;
-  [super makeKeyAndOrderFront:sender];
-}
-
 - (void)dealloc
 {
   [mActiveTitlebarColor release];
   [mInactiveTitlebarColor release];
   [self removeTrackingArea];
   ChildViewMouseTracker::OnDestroyWindow(self);
   [super dealloc];
 }
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -91,18 +91,18 @@ typedef void* nsNativeWidget;
 #ifdef XP_WIN
 #define NS_NATIVE_TSF_THREAD_MGR       100
 #define NS_NATIVE_TSF_CATEGORY_MGR     101
 #define NS_NATIVE_TSF_DISPLAY_ATTR_MGR 102
 #define NS_NATIVE_ICOREWINDOW          103 // winrt specific
 #endif
 
 #define NS_IWIDGET_IID \
-{ 0xa1f684e6, 0x2ae1, 0x4513, \
-  { 0xb6, 0x89, 0xf4, 0xd4, 0xfe, 0x9d, 0x2c, 0xdb } }
+{ 0x1ebdb596, 0x0f90, 0x4f02, \
+  { 0x97, 0x07, 0x4e, 0xc1, 0x16, 0xcd, 0x54, 0xf6 } }
 
 /*
  * Window shadow styles
  * Also used for the -moz-window-shadow CSS property
  */
 
 #define NS_STYLE_WINDOW_SHADOW_NONE             0
 #define NS_STYLE_WINDOW_SHADOW_DEFAULT          1
@@ -1210,33 +1210,17 @@ class nsIWidget : public nsISupports {
     /**
      * Called when shutting down the LayerManager to clean-up any cached resources.
      *
      * Always called from the compositing thread, which may be the main-thread if
      * OMTC is not enabled.
      */
     virtual void CleanupWindowEffects() = 0;
 
-    /**
-     * Called before rendering using OpenGL. Returns false when the widget is
-     * not ready to be rendered (for example while the window is closed).
-     *
-     * Always called from the compositing thread, which may be the main-thread if
-     * OMTC is not enabled.
-     */
-    virtual bool PreRender(LayerManager* aManager) = 0;
-
-    /**
-     * Called after rendering using OpenGL. Not called when rendering was
-     * cancelled by a negative return value from PreRender.
-     *
-     * Always called from the compositing thread, which may be the main-thread if
-     * OMTC is not enabled.
-     */
-    virtual void PostRender(LayerManager* aManager) = 0;
+    virtual void PreRender(LayerManager* aManager) = 0;
 
     /**
      * Called before the LayerManager draws the layer tree.
      *
      * Always called from the compositing thread, which may be the main-thread if
      * OMTC is not enabled.
      */
     virtual void DrawWindowUnderlay(LayerManager* aManager, nsIntRect aRect) = 0;
--- a/widget/xpwidgets/nsBaseWidget.h
+++ b/widget/xpwidgets/nsBaseWidget.h
@@ -131,18 +131,17 @@ public:
                                           LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
                                           bool* aAllowRetaining = nullptr);
 
   virtual CompositorParent* NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight);
   virtual void            CreateCompositor();
   virtual void            CreateCompositor(int aWidth, int aHeight);
   virtual void            PrepareWindowEffects() {}
   virtual void            CleanupWindowEffects() {}
-  virtual bool            PreRender(LayerManager* aManager) { return true; }
-  virtual void            PostRender(LayerManager* aManager) {}
+  virtual void            PreRender(LayerManager* aManager) {}
   virtual void            DrawWindowUnderlay(LayerManager* aManager, nsIntRect aRect) {}
   virtual void            DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) {}
   virtual mozilla::TemporaryRef<mozilla::gfx::DrawTarget> StartRemoteDrawing();
   virtual void            EndRemoteDrawing() { };
   virtual void            CleanupRemoteDrawing() { };
   virtual void            UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) {}
   virtual gfxASurface*    GetThebesSurface();
   NS_IMETHOD              SetModal(bool aModal);