mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 759162 - Part 2: Make CompositorParent::ScheduleResumeOnCompositorThread block until the compositor resumes. r=bgirard
This commit is contained in:
parent
272f08ff30
commit
b802df3029
@ -38,6 +38,7 @@ CompositorParent::CompositorParent(nsIWidget* aWidget, MessageLoop* aMsgLoop,
|
||||
, mRenderToEGLSurface(aRenderToEGLSurface)
|
||||
, mEGLSurfaceSize(aSurfaceWidth, aSurfaceHeight)
|
||||
, mPauseCompositionMonitor("PauseCompositionMonitor")
|
||||
, mResumeCompositionMonitor("ResumeCompositionMonitor")
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositorParent);
|
||||
}
|
||||
@ -133,11 +134,17 @@ CompositorParent::ResumeComposition()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(CompositorThreadID() == PlatformThread::CurrentId(),
|
||||
"ResumeComposition() can only be called on the compositor thread");
|
||||
|
||||
mozilla::MonitorAutoLock lock(mResumeCompositionMonitor);
|
||||
|
||||
mPaused = false;
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
static_cast<LayerManagerOGL*>(mLayerManager.get())->gl()->RenewSurface();
|
||||
#endif
|
||||
|
||||
// if anyone's waiting to make sure that composition really got resumed, tell them
|
||||
lock.NotifyAll();
|
||||
}
|
||||
|
||||
void
|
||||
@ -179,9 +186,14 @@ CompositorParent::SchedulePauseOnCompositorThread()
|
||||
void
|
||||
CompositorParent::ScheduleResumeOnCompositorThread(int width, int height)
|
||||
{
|
||||
mozilla::MonitorAutoLock lock(mResumeCompositionMonitor);
|
||||
|
||||
CancelableTask *resumeTask =
|
||||
NewRunnableMethod(this, &CompositorParent::ResumeCompositionAndResize, width, height);
|
||||
CompositorLoop()->PostTask(FROM_HERE, resumeTask);
|
||||
|
||||
// Wait until the resume has actually been processed by the compositor thread
|
||||
lock.Wait();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -144,6 +144,7 @@ private:
|
||||
nsIntSize mEGLSurfaceSize;
|
||||
|
||||
mozilla::Monitor mPauseCompositionMonitor;
|
||||
mozilla::Monitor mResumeCompositionMonitor;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user