Bug 1405778. Remove largely unneeded call to nsDisplayBackgroundColor::GetLayerState. r=kats

Text clipping is the only thing we don't handle and it's better to just have this inline.
This commit is contained in:
Jeff Muizelaar 2017-10-04 16:51:23 -04:00
Родитель 64679f72a4
Коммит 5a5f5bcef6
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -538,7 +538,7 @@ private:
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.print-histogram", FPSPrintHistogram, bool, false); DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.print-histogram", FPSPrintHistogram, bool, false);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false); DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false);
DECL_GFX_PREF(Once, "layers.acceleration.force-enabled", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false); DECL_GFX_PREF(Once, "layers.acceleration.force-enabled", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
DECL_OVERRIDE_PREF(Live, "layers.advanced.background-color", LayersAllowBackgroundColorLayers, gfxPrefs::OverrideBase_WebRender()); DECL_GFX_PREF(Live, "layers.advanced.background-color", LayersAllowBackgroundColorLayers, bool, false);
DECL_OVERRIDE_PREF(Live, "layers.advanced.background-image", LayersAllowBackgroundImage, gfxPrefs::OverrideBase_WebRender()); DECL_OVERRIDE_PREF(Live, "layers.advanced.background-image", LayersAllowBackgroundImage, gfxPrefs::OverrideBase_WebRender());
DECL_GFX_PREF(Live, "layers.advanced.basic-layer.enabled", LayersAdvancedBasicLayerEnabled, bool, false); DECL_GFX_PREF(Live, "layers.advanced.basic-layer.enabled", LayersAdvancedBasicLayerEnabled, bool, false);
DECL_OVERRIDE_PREF(Live, "layers.advanced.border-layers", LayersAllowBorderLayers, gfxPrefs::OverrideBase_WebRender()); DECL_OVERRIDE_PREF(Live, "layers.advanced.border-layers", LayersAllowBorderLayers, gfxPrefs::OverrideBase_WebRender());

Просмотреть файл

@ -4262,15 +4262,15 @@ nsDisplayBackgroundColor::CreateWebRenderCommands(mozilla::wr::DisplayListBuilde
mozilla::layers::WebRenderLayerManager* aManager, mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) nsDisplayListBuilder* aDisplayListBuilder)
{ {
ContainerLayerParameters parameter;
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
return false;
}
if (mColor == Color()) { if (mColor == Color()) {
return true; return true;
} }
StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[0].mClip;
if (clip == StyleGeometryBox::Text) {
return false;
}
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits( LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel()); mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel());
wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(bounds); wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(bounds);

Просмотреть файл

@ -5885,7 +5885,7 @@ pref("layers.mlgpu.enable-on-windows7", true);
// it to a boolean as appropriate. In particular, do NOT add ifdefs here to // it to a boolean as appropriate. In particular, do NOT add ifdefs here to
// turn these on and off, instead use the conditional-pref code in gfxPrefs.h // turn these on and off, instead use the conditional-pref code in gfxPrefs.h
// to do that. // to do that.
pref("layers.advanced.background-color", 2); pref("layers.advanced.background-color", false);
pref("layers.advanced.background-image", 2); pref("layers.advanced.background-image", 2);
pref("layers.advanced.border-layers", 2); pref("layers.advanced.border-layers", 2);
pref("layers.advanced.boxshadow-inset-layers", 2); pref("layers.advanced.boxshadow-inset-layers", 2);