mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1377321 - Only use WebRender for top-level windows and remote content. r=kats
This commit is contained in:
parent
8ebc9420bc
commit
b5d400cfab
@ -886,6 +886,12 @@ bool nsBaseWidget::IsSmallPopup() const
|
||||
bool
|
||||
nsBaseWidget::ComputeShouldAccelerate()
|
||||
{
|
||||
if (gfx::gfxVars::UseWebRender() && !AllowWebRenderForThisWindow()) {
|
||||
// If WebRender is enabled, non-WebRender widgets use the basic compositor
|
||||
// (at least for now), even though they would get an accelerated compositor
|
||||
// if WebRender wasn't enabled.
|
||||
return false;
|
||||
}
|
||||
return gfx::gfxConfig::IsEnabled(gfx::Feature::HW_COMPOSITING) &&
|
||||
WidgetTypeSupportsAcceleration();
|
||||
}
|
||||
@ -900,6 +906,12 @@ nsBaseWidget::UseAPZ()
|
||||
gfxPrefs::APZPopupsEnabled())));
|
||||
}
|
||||
|
||||
bool
|
||||
nsBaseWidget::AllowWebRenderForThisWindow()
|
||||
{
|
||||
return WindowType() == eWindowType_toplevel || HasRemoteContent();
|
||||
}
|
||||
|
||||
void nsBaseWidget::CreateCompositor()
|
||||
{
|
||||
LayoutDeviceIntRect rect = GetBounds();
|
||||
@ -1276,7 +1288,8 @@ nsBaseWidget::CreateCompositorSession(int aWidth,
|
||||
// If widget type does not supports acceleration, we use ClientLayerManager
|
||||
// even when gfxVars::UseWebRender() is true. WebRender could coexist only
|
||||
// with BasicCompositor.
|
||||
bool enableWR = gfx::gfxVars::UseWebRender() && WidgetTypeSupportsAcceleration();
|
||||
bool enableWR = gfx::gfxVars::UseWebRender() && WidgetTypeSupportsAcceleration()
|
||||
&& AllowWebRenderForThisWindow();
|
||||
bool enableAPZ = UseAPZ();
|
||||
CompositorOptions options(enableAPZ, enableWR);
|
||||
|
||||
|
@ -602,6 +602,8 @@ protected:
|
||||
|
||||
bool UseAPZ();
|
||||
|
||||
bool AllowWebRenderForThisWindow();
|
||||
|
||||
/**
|
||||
* For widgets that support synthesizing native touch events, this function
|
||||
* can be used to manage the current state of synthetic pointers. Each widget
|
||||
|
Loading…
Reference in New Issue
Block a user