зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1300121 - Flush the D3D11 immediate context if a composition is cancelled to avoid resources queing up in the driver. r=Bas
This commit is contained in:
Родитель
b36168c508
Коммит
5e3ab0af14
|
@ -427,6 +427,8 @@ public:
|
|||
*/
|
||||
virtual void EndFrame();
|
||||
|
||||
virtual void CancelFrame() { ReadUnlockTextures(); }
|
||||
|
||||
virtual void SetDispAcquireFence(Layer* aLayer);
|
||||
|
||||
/**
|
||||
|
|
|
@ -150,6 +150,7 @@ LayerManagerComposite::Destroy()
|
|||
if (mRoot) {
|
||||
RootLayer()->Destroy();
|
||||
}
|
||||
mCompositor->CancelFrame();
|
||||
mRoot = nullptr;
|
||||
mClonedLayerTreeProperties = nullptr;
|
||||
mPaintCounter = nullptr;
|
||||
|
@ -1320,6 +1321,9 @@ LayerManagerComposite::AutoAddMaskEffect::~AutoAddMaskEffect()
|
|||
void
|
||||
LayerManagerComposite::ChangeCompositor(Compositor* aNewCompositor)
|
||||
{
|
||||
if (mCompositor) {
|
||||
mCompositor->CancelFrame();
|
||||
}
|
||||
mCompositor = aNewCompositor;
|
||||
mTextRenderer = new TextRenderer(aNewCompositor);
|
||||
mTwoPassTmpTarget = nullptr;
|
||||
|
|
|
@ -1031,6 +1031,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
|
|||
}
|
||||
|
||||
if (clipRect.IsEmpty()) {
|
||||
CancelFrame();
|
||||
*aRenderBoundsOut = IntRect();
|
||||
return;
|
||||
}
|
||||
|
@ -1184,6 +1185,15 @@ CompositorD3D11::EndFrame()
|
|||
mCurrentRT = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
CompositorD3D11::CancelFrame()
|
||||
{
|
||||
ReadUnlockTextures();
|
||||
// Flush the context, otherwise the driver might hold some resources alive
|
||||
// until the next flush or present.
|
||||
mContext->Flush();
|
||||
}
|
||||
|
||||
void
|
||||
CompositorD3D11::PrepareViewport(const gfx::IntSize& aSize)
|
||||
{
|
||||
|
|
|
@ -115,6 +115,8 @@ public:
|
|||
*/
|
||||
virtual void EndFrame() override;
|
||||
|
||||
virtual void CancelFrame() override;
|
||||
|
||||
/**
|
||||
* Setup the viewport and projection matrix for rendering
|
||||
* to a window of the given dimensions.
|
||||
|
|
Загрузка…
Ссылка в новой задаче