diff options
author | wicknix <39230578+wicknix@users.noreply.github.com> | 2019-04-15 18:58:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 18:58:07 -0500 |
commit | 5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch) | |
tree | 62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /widget/windows/WinCompositorWidget.cpp | |
parent | 065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff) | |
parent | 095ea556855b38138e39e713f482eb440f7da9b2 (diff) | |
download | UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip |
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'widget/windows/WinCompositorWidget.cpp')
-rw-r--r-- | widget/windows/WinCompositorWidget.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/widget/windows/WinCompositorWidget.cpp b/widget/windows/WinCompositorWidget.cpp index f660bd019..99ce67573 100644 --- a/widget/windows/WinCompositorWidget.cpp +++ b/widget/windows/WinCompositorWidget.cpp @@ -22,6 +22,7 @@ using namespace mozilla::gfx; WinCompositorWidget::WinCompositorWidget(const CompositorWidgetInitData& aInitData) : mWidgetKey(aInitData.widgetKey()), mWnd(reinterpret_cast<HWND>(aInitData.hWnd())), + mTransparentSurfaceLock("mTransparentSurfaceLock"), mTransparencyMode(static_cast<nsTransparencyMode>(aInitData.transparencyMode())), mMemoryDC(nullptr), mCompositeDC(nullptr), @@ -39,6 +40,7 @@ WinCompositorWidget::WinCompositorWidget(const CompositorWidgetInitData& aInitDa void WinCompositorWidget::OnDestroyWindow() { + MutexAutoLock lock(mTransparentSurfaceLock); mTransparentSurface = nullptr; mMemoryDC = nullptr; } @@ -75,6 +77,8 @@ WinCompositorWidget::GetClientSize() already_AddRefed<gfx::DrawTarget> WinCompositorWidget::StartRemoteDrawing() { + MutexAutoLock lock(mTransparentSurfaceLock); + MOZ_ASSERT(!mCompositeDC); RefPtr<gfxASurface> surf; @@ -229,6 +233,7 @@ WinCompositorWidget::LeavePresentLock() RefPtr<gfxASurface> WinCompositorWidget::EnsureTransparentSurface() { + mTransparentSurfaceLock.AssertCurrentThreadOwns(); MOZ_ASSERT(mTransparencyMode == eTransparencyTransparent); IntSize size = GetClientSize().ToUnknownSize(); @@ -245,6 +250,7 @@ WinCompositorWidget::EnsureTransparentSurface() void WinCompositorWidget::CreateTransparentSurface(const gfx::IntSize& aSize) { + mTransparentSurfaceLock.AssertCurrentThreadOwns(); MOZ_ASSERT(!mTransparentSurface && !mMemoryDC); RefPtr<gfxWindowsSurface> surface = new gfxWindowsSurface(aSize, SurfaceFormat::A8R8G8B8_UINT32); mTransparentSurface = surface; @@ -254,6 +260,7 @@ WinCompositorWidget::CreateTransparentSurface(const gfx::IntSize& aSize) void WinCompositorWidget::UpdateTransparency(nsTransparencyMode aMode) { + MutexAutoLock lock(mTransparentSurfaceLock); if (mTransparencyMode == aMode) { return; } @@ -270,6 +277,7 @@ WinCompositorWidget::UpdateTransparency(nsTransparencyMode aMode) void WinCompositorWidget::ClearTransparentWindow() { + MutexAutoLock lock(mTransparentSurfaceLock); if (!mTransparentSurface) { return; } |