Bug 1292288 - Don't hold both the effects lock and the GL lock at the same time in PrepareWindowEffects to avoid deadlock. r=mstange

--HG--
extra : rebase_source : f80ae0cfca630b7a414eea8921047996a9122104
This commit is contained in:
Matt Woodrow 2016-08-05 11:33:06 +12:00
Родитель bf8a0ba830
Коммит af772b40e6
1 изменённых файлов: 16 добавлений и 12 удалений

Просмотреть файл

@ -1994,23 +1994,27 @@ nsChildView::PrepareWindowEffects()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
MutexAutoLock lock(mEffectsLock);
mShowsResizeIndicator = ShowsResizeIndicator(&mResizeIndicatorRect);
mHasRoundedBottomCorners = [(ChildView*)mView hasRoundedBottomCorners];
CGFloat cornerRadius = [(ChildView*)mView cornerRadius];
mDevPixelCornerRadius = cornerRadius * BackingScaleFactor();
mIsCoveringTitlebar = [(ChildView*)mView isCoveringTitlebar];
NSInteger styleMask = [[mView window] styleMask];
bool isFullscreen = (styleMask & NSFullScreenWindowMask) || !(styleMask & NSTitledWindowMask);
bool isFullscreen;
{
MutexAutoLock lock(mEffectsLock);
mShowsResizeIndicator = ShowsResizeIndicator(&mResizeIndicatorRect);
mHasRoundedBottomCorners = [(ChildView*)mView hasRoundedBottomCorners];
CGFloat cornerRadius = [(ChildView*)mView cornerRadius];
mDevPixelCornerRadius = cornerRadius * BackingScaleFactor();
mIsCoveringTitlebar = [(ChildView*)mView isCoveringTitlebar];
NSInteger styleMask = [[mView window] styleMask];
isFullscreen = (styleMask & NSFullScreenWindowMask) || !(styleMask & NSTitledWindowMask);
if (mIsCoveringTitlebar) {
mTitlebarRect = RectContainingTitlebarControls();
UpdateTitlebarCGContext();
}
}
// If we've just transitioned into or out of full screen then update the opacity on our GLContext.
if (isFullscreen != mIsFullscreen) {
mIsFullscreen = isFullscreen;
[(ChildView*)mView setFullscreen:isFullscreen];
}
if (mIsCoveringTitlebar) {
mTitlebarRect = RectContainingTitlebarControls();
UpdateTitlebarCGContext();
}
NS_OBJC_END_TRY_ABORT_BLOCK;
}