mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 963952 - [e10s] Don't use basic compositor when using D3D11 compositor (r=mattwoodrow)
This commit is contained in:
parent
f9670827d3
commit
785a0402ee
@ -25,6 +25,15 @@ Compositor::GetBackend()
|
||||
return sBackend;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
Compositor::SetBackend(LayersBackend backend)
|
||||
{
|
||||
if (sBackend != LayersBackend::LAYERS_NONE && sBackend != backend) {
|
||||
MOZ_CRASH("Trying to use more than one OMTC compositor.");
|
||||
}
|
||||
sBackend = backend;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
Compositor::AssertOnCompositorThread()
|
||||
{
|
||||
|
@ -465,8 +465,12 @@ protected:
|
||||
|
||||
bool ShouldDrawDiagnostics(DiagnosticFlags);
|
||||
|
||||
/**
|
||||
* Set the global Compositor backend, checking that one isn't already set.
|
||||
*/
|
||||
static void SetBackend(LayersBackend backend);
|
||||
|
||||
uint32_t mCompositorID;
|
||||
static LayersBackend sBackend;
|
||||
DiagnosticTypes mDiagnosticTypes;
|
||||
PCompositorParent* mParent;
|
||||
|
||||
@ -477,6 +481,10 @@ protected:
|
||||
*/
|
||||
size_t mPixelsPerFrame;
|
||||
size_t mPixelsFilled;
|
||||
|
||||
private:
|
||||
static LayersBackend sBackend;
|
||||
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
@ -227,7 +227,7 @@ BasicCompositor::BasicCompositor(nsIWidget *aWidget)
|
||||
: mWidget(aWidget)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicCompositor);
|
||||
sBackend = LayersBackend::LAYERS_BASIC;
|
||||
SetBackend(LayersBackend::LAYERS_BASIC);
|
||||
}
|
||||
|
||||
BasicCompositor::~BasicCompositor()
|
||||
|
@ -65,7 +65,7 @@ CompositorD3D11::CompositorD3D11(nsIWidget* aWidget)
|
||||
, mHwnd(nullptr)
|
||||
, mDisableSequenceForNextFrame(false)
|
||||
{
|
||||
sBackend = LayersBackend::LAYERS_D3D11;
|
||||
SetBackend(LayersBackend::LAYERS_D3D11);
|
||||
}
|
||||
|
||||
CompositorD3D11::~CompositorD3D11()
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
@ -26,7 +26,7 @@ CompositorD3D9::CompositorD3D9(PCompositorParent* aParent, nsIWidget *aWidget)
|
||||
, mWidget(aWidget)
|
||||
, mDeviceResetCount(0)
|
||||
{
|
||||
sBackend = LayersBackend::LAYERS_D3D9;
|
||||
Compositor::SetBackend(LayersBackend::LAYERS_D3D9);
|
||||
}
|
||||
|
||||
CompositorD3D9::~CompositorD3D9()
|
||||
|
@ -146,7 +146,7 @@ CompositorOGL::CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth,
|
||||
, mHeight(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositorOGL);
|
||||
sBackend = LayersBackend::LAYERS_OPENGL;
|
||||
SetBackend(LayersBackend::LAYERS_OPENGL);
|
||||
}
|
||||
|
||||
CompositorOGL::~CompositorOGL()
|
||||
|
@ -6509,6 +6509,19 @@ nsWindow::StartAllowingD3D9(bool aReinitialize)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsWindow::ShouldUseOffMainThreadCompositing()
|
||||
{
|
||||
// We don't currently support using an accelerated layer manager with
|
||||
// transparent windows so don't even try. I'm also not sure if we even
|
||||
// want to support this case. See bug 593471
|
||||
if (mTransparencyMode == eTransparencyTransparent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return nsBaseWidget::ShouldUseOffMainThreadCompositing();
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::GetPreferredCompositorBackends(nsTArray<LayersBackend>& aHints)
|
||||
{
|
||||
|
@ -287,6 +287,8 @@ public:
|
||||
|
||||
virtual void GetPreferredCompositorBackends(nsTArray<mozilla::layers::LayersBackend>& aHints);
|
||||
|
||||
virtual bool ShouldUseOffMainThreadCompositing();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void WindowUsesOMTC() MOZ_OVERRIDE;
|
||||
|
Loading…
Reference in New Issue
Block a user