Bug 1394711 - nsDisplayBackgroundImage should check layer state to create webrender commands. r=kats
authorEthan Lin <ethlin@mozilla.com>
Tue, 29 Aug 2017 14:51:06 +0800
changeset 377700 47914cdf92a5265664e1b83be82faa5d5b966d55
parent 377699 03245d48dbed8a49319cacdbe586d22b0aa4dee2
child 377701 cfd465206f799632bb16c4da3bf27a738aa1535a
push id49982
push userethlin@mozilla.com
push dateWed, 30 Aug 2017 06:12:31 +0000
treeherderautoland@47914cdf92a5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1394711
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1394711 - nsDisplayBackgroundImage should check layer state to create webrender commands. r=kats MozReview-Commit-ID: Lr1Yfcd50iK
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -3548,18 +3548,21 @@ nsDisplayBackgroundImage::CanBuildWebRen
 
 bool
 nsDisplayBackgroundImage::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                                   const StackingContextHelper& aSc,
                                                   nsTArray<WebRenderParentCommand>& aParentCommands,
                                                   WebRenderLayerManager* aManager,
                                                   nsDisplayListBuilder* aDisplayListBuilder)
 {
-  if (!CanBuildWebRenderDisplayItems(aManager)) {
-    return false;
+  if (aManager->IsLayersFreeTransaction()) {
+    ContainerLayerParameters parameter;
+    if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
+      return false;
+    }
   }
 
   if (aDisplayListBuilder) {
     mImageFlags = aDisplayListBuilder->GetBackgroundPaintFlags();
   }
   CheckForBorderItem(this, mImageFlags);
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForSingleLayer(*StyleFrame()->PresContext(),