Backed out changeset 0ef199e4d83d (bug 1467363) for failures on BlockingResourceBase.cpp CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Fri, 22 Jun 2018 01:31:07 +0300
changeset 477524 6c29e4fc89c79a9a710eaa349f138cc84115ffd8
parent 477523 5abb841c6ec2cc629f33a0d519fb879d70e51d7d
child 477525 b67973aeb2af232a387f926e0103a140c98f8865
push id9385
push userdluca@mozilla.com
push dateFri, 22 Jun 2018 15:47:18 +0000
treeherdermozilla-beta@82a9a1027e2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1467363
milestone62.0a1
backs out0ef199e4d83dad031c14f97d9524a30f0b0cf97e
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 changeset 0ef199e4d83d (bug 1467363) for failures on BlockingResourceBase.cpp CLOSED TREE
widget/windows/WinCompositorWidget.cpp
widget/windows/WinCompositorWidget.h
--- a/widget/windows/WinCompositorWidget.cpp
+++ b/widget/windows/WinCompositorWidget.cpp
@@ -14,25 +14,23 @@
 #include "WinCompositorWindowThread.h"
 
 #include <ddraw.h>
 
 namespace mozilla {
 namespace widget {
 
 using namespace mozilla::gfx;
-using namespace mozilla;
 
 WinCompositorWidget::WinCompositorWidget(const WinCompositorWidgetInitData& aInitData,
                                          const layers::CompositorOptions& aOptions)
  : CompositorWidget(aOptions)
  , mWidgetKey(aInitData.widgetKey()),
    mWnd(reinterpret_cast<HWND>(aInitData.hWnd())),
    mCompositorWnd(nullptr),
-   mTransparentSurfaceLock("mTransparentSurfaceLock"),
    mTransparencyMode(aInitData.transparencyMode()),
    mMemoryDC(nullptr),
    mCompositeDC(nullptr),
    mLockedBackBufferData(nullptr)
 {
   MOZ_ASSERT(mWnd && ::IsWindow(mWnd));
 
   // mNotDeferEndRemoteDrawing is set on the main thread during init,
@@ -45,17 +43,16 @@ WinCompositorWidget::WinCompositorWidget
 WinCompositorWidget::~WinCompositorWidget()
 {
   DestroyCompositorWindow();
 }
 
 void
 WinCompositorWidget::OnDestroyWindow()
 {
-  MutexAutoLock lock(mTransparentSurfaceLock);
   mTransparentSurface = nullptr;
   mMemoryDC = nullptr;
 }
 
 bool
 WinCompositorWidget::PreRender(WidgetRenderingContext* aContext)
 {
   // This can block waiting for WM_SETTEXT to finish
@@ -82,18 +79,16 @@ WinCompositorWidget::GetClientSize()
   return LayoutDeviceIntSize(
     r.right - r.left,
     r.bottom - r.top);
 }
 
 already_AddRefed<gfx::DrawTarget>
 WinCompositorWidget::StartRemoteDrawing()
 {
-  MutexAutoLock lock(mTransparentSurfaceLock);
-
   MOZ_ASSERT(!mCompositeDC);
 
   RefPtr<gfxASurface> surf;
   if (mTransparencyMode == eTransparencyTransparent) {
     surf = EnsureTransparentSurface();
   }
 
   // Must call this after EnsureTransparentSurface(), since it could update
@@ -244,61 +239,57 @@ void
 WinCompositorWidget::LeavePresentLock()
 {
   mPresentLock.Leave();
 }
 
 RefPtr<gfxASurface>
 WinCompositorWidget::EnsureTransparentSurface()
 {
-  mTransparentSurfaceLock.AssertCurrentThreadOwns();
   MOZ_ASSERT(mTransparencyMode == eTransparencyTransparent);
 
   IntSize size = GetClientSize().ToUnknownSize();
   if (!mTransparentSurface || mTransparentSurface->GetSize() != size) {
     mTransparentSurface = nullptr;
     mMemoryDC = nullptr;
     CreateTransparentSurface(size);
   }
 
   RefPtr<gfxASurface> surface = mTransparentSurface;
   return surface.forget();
 }
 
 void
 WinCompositorWidget::CreateTransparentSurface(const gfx::IntSize& aSize)
 {
-  mTransparentSurfaceLock.AssertCurrentThreadOwns();
   MOZ_ASSERT(!mTransparentSurface && !mMemoryDC);
   RefPtr<gfxWindowsSurface> surface = new gfxWindowsSurface(aSize, SurfaceFormat::A8R8G8B8_UINT32);
   mTransparentSurface = surface;
   mMemoryDC = surface->GetDC();
 }
 
 void
 WinCompositorWidget::UpdateTransparency(nsTransparencyMode aMode)
 {
-  MutexAutoLock lock(mTransparentSurfaceLock);
   if (mTransparencyMode == aMode) {
     return;
   }
 
   mTransparencyMode = aMode;
   mTransparentSurface = nullptr;
   mMemoryDC = nullptr;
 
   if (mTransparencyMode == eTransparencyTransparent) {
     EnsureTransparentSurface();
   }
 }
 
 void
 WinCompositorWidget::ClearTransparentWindow()
 {
-  MutexAutoLock lock(mTransparentSurfaceLock);
   if (!mTransparentSurface) {
     return;
   }
 
   EnsureTransparentSurface();
 
   IntSize size = mTransparentSurface->GetSize();
   if (!size.IsEmpty()) {
--- a/widget/windows/WinCompositorWidget.h
+++ b/widget/windows/WinCompositorWidget.h
@@ -5,17 +5,16 @@
 
 #ifndef widget_windows_WinCompositorWidget_h
 #define widget_windows_WinCompositorWidget_h
 
 #include "CompositorWidget.h"
 #include "gfxASurface.h"
 #include "mozilla/gfx/CriticalSection.h"
 #include "mozilla/gfx/Point.h"
-#include "mozilla/Mutex.h"
 #include "nsIWidget.h"
 
 class nsWindow;
 
 namespace mozilla {
 namespace widget {
 
 class PlatformCompositorWidgetDelegate
@@ -120,17 +119,16 @@ private:
   HWND mWnd;
 
   HWND mCompositorWnd;
   LayoutDeviceIntSize mLastCompositorWndSize;
 
   gfx::CriticalSection mPresentLock;
 
   // Transparency handling.
-  mozilla::Mutex mTransparentSurfaceLock;
   nsTransparencyMode mTransparencyMode;
   RefPtr<gfxASurface> mTransparentSurface;
   HDC mMemoryDC;
   HDC mCompositeDC;
 
   // Locked back buffer of BasicCompositor
   uint8_t* mLockedBackBufferData;