Bug 1000875 - Add invalidation debugging annotations for changes of a layer's forced background color. r=roc
authorMarkus Stange <mstange@themasta.com>
Mon, 05 May 2014 10:26:28 +0200
changeset 181533 baaaf70d2bca5bb6935ae93250b3b002a3d252e9
parent 181532 6607fab12f181c38b1114222744bd2f5b670e30c
child 181534 fd797f07d0dbf708e67d86161baa6775db5f5ae7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs1000875
milestone32.0a1
Bug 1000875 - Add invalidation debugging annotations for changes of a layer's forced background color. r=roc
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1970,16 +1970,25 @@ ContainerState::PopThebesLayerData()
 
     // Store the background color
     ThebesDisplayItemLayerUserData* userData =
       GetThebesDisplayItemLayerUserData(data->mLayer);
     NS_ASSERTION(userData, "where did our user data go?");
     if (userData->mForcedBackgroundColor != backgroundColor) {
       // Invalidate the entire target ThebesLayer since we're changing
       // the background color
+#ifdef MOZ_DUMP_PAINTING
+      if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
+        printf_stderr("Forced background color has changed from #%08X to #%08X on layer %p\n",
+                      userData->mForcedBackgroundColor, backgroundColor, data->mLayer);
+        nsAutoCString str;
+        AppendToString(str, data->mLayer->GetValidRegion());
+        printf_stderr("Invalidating layer %p: %s\n", data->mLayer, str.get());
+      }
+#endif
       data->mLayer->InvalidateRegion(data->mLayer->GetValidRegion());
     }
     userData->mForcedBackgroundColor = backgroundColor;
 
     // use a mask layer for rounded rect clipping.
     // data->mCommonClipCount may be -1 if we haven't put any actual
     // drawable items in this layer (i.e. it's only catching events).
     int32_t commonClipCount = std::max(0, data->mCommonClipCount);