зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1326421 - Add a compositor option for WebRender being enabled or not. r=dvander
MozReview-Commit-ID: LeQRgKSn0Ql
This commit is contained in:
Родитель
1417e1a7ab
Коммит
c9bbaf820c
|
@ -31,20 +31,25 @@ public:
|
|||
// This constructor needed for IPDL purposes, don't use it anywhere else.
|
||||
CompositorOptions()
|
||||
: mUseAPZ(false)
|
||||
, mUseWebRender(false)
|
||||
{
|
||||
}
|
||||
|
||||
explicit CompositorOptions(bool aUseAPZ)
|
||||
explicit CompositorOptions(bool aUseAPZ,
|
||||
bool aUseWebRender)
|
||||
: mUseAPZ(aUseAPZ)
|
||||
, mUseWebRender(aUseWebRender)
|
||||
{
|
||||
}
|
||||
|
||||
bool UseAPZ() const { return mUseAPZ; }
|
||||
bool UseWebRender() const { return mUseWebRender; }
|
||||
|
||||
friend struct IPC::ParamTraits<CompositorOptions>;
|
||||
|
||||
private:
|
||||
bool mUseAPZ;
|
||||
bool mUseWebRender;
|
||||
|
||||
// Make sure to add new fields to the ParamTraits implementation
|
||||
};
|
||||
|
|
|
@ -1326,10 +1326,12 @@ struct ParamTraits<mozilla::layers::CompositorOptions>
|
|||
|
||||
static void Write(Message* aMsg, const paramType& aParam) {
|
||||
WriteParam(aMsg, aParam.mUseAPZ);
|
||||
WriteParam(aMsg, aParam.mUseWebRender);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
|
||||
return ReadParam(aMsg, aIter, &aResult->mUseAPZ);
|
||||
return ReadParam(aMsg, aIter, &aResult->mUseAPZ)
|
||||
&& ReadParam(aMsg, aIter, &aResult->mUseWebRender);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1298,15 +1298,15 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
|
|||
|
||||
CreateCompositorVsyncDispatcher();
|
||||
|
||||
CompositorOptions options(UseAPZ(), gfxPrefs::WebRenderEnabled());
|
||||
|
||||
RefPtr<LayerManager> lm;
|
||||
if (gfxPrefs::WebRenderEnabled()) {
|
||||
if (options.UseWebRender()) {
|
||||
lm = new WebRenderLayerManager(this);
|
||||
} else {
|
||||
lm = new ClientLayerManager(this);
|
||||
}
|
||||
|
||||
CompositorOptions options(UseAPZ());
|
||||
|
||||
gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
|
||||
mCompositorSession = gpu->CreateTopLevelCompositor(
|
||||
this,
|
||||
|
|
|
@ -3910,7 +3910,7 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
|
|||
reinterpret_cast<uintptr_t>(static_cast<nsIWidget*>(this)),
|
||||
mTransparencyMode);
|
||||
// If we're not using the compositor, the options don't actually matter.
|
||||
CompositorOptions options(false);
|
||||
CompositorOptions options(false, false);
|
||||
mBasicLayersSurface = new InProcessWinCompositorWidget(initData, options, this);
|
||||
mCompositorWidgetDelegate = mBasicLayersSurface;
|
||||
mLayerManager = CreateBasicLayerManager();
|
||||
|
|
Загрузка…
Ссылка в новой задаче