mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1576087 - Split EGLSurface creation from RenderCompositorANGLE::ResizeBufferIfNeeded() r=nical
Differential Revision: https://phabricator.services.mozilla.com/D43212 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
40fff309dd
commit
6ad6dcbc80
@ -400,14 +400,32 @@ bool RenderCompositorANGLE::ResizeBufferIfNeeded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT hr;
|
||||
RefPtr<ID3D11Texture2D> backBuf;
|
||||
|
||||
// Release EGLSurface of back buffer before calling ResizeBuffers().
|
||||
DestroyEGLSurface();
|
||||
|
||||
// Reset buffer size
|
||||
mBufferSize.reset();
|
||||
mBufferSize = Some(size);
|
||||
|
||||
if (!CreateEGLSurface()) {
|
||||
mBufferSize.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RenderCompositorANGLE::CreateEGLSurface() {
|
||||
MOZ_ASSERT(mBufferSize.isSome());
|
||||
MOZ_ASSERT(mEGLSurface == EGL_NO_SURFACE);
|
||||
|
||||
HRESULT hr;
|
||||
RefPtr<ID3D11Texture2D> backBuf;
|
||||
|
||||
if (mBufferSize.isNothing()) {
|
||||
gfxCriticalNote << "Buffer size is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
const LayoutDeviceIntSize& size = mBufferSize.ref();
|
||||
|
||||
// Resize swap chain
|
||||
DXGI_SWAP_CHAIN_DESC desc;
|
||||
@ -462,7 +480,6 @@ bool RenderCompositorANGLE::ResizeBufferIfNeeded() {
|
||||
}
|
||||
|
||||
mEGLSurface = surface;
|
||||
mBufferSize = Some(size);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ class RenderCompositorANGLE : public RenderCompositor {
|
||||
void InsertPresentWaitQuery();
|
||||
bool WaitForPreviousPresentQuery();
|
||||
bool ResizeBufferIfNeeded();
|
||||
bool CreateEGLSurface();
|
||||
void DestroyEGLSurface();
|
||||
ID3D11Device* GetDeviceOfEGLDisplay();
|
||||
void CreateSwapChainForDCompIfPossible(IDXGIFactory2* aDXGIFactory2);
|
||||
|
Loading…
Reference in New Issue
Block a user