Bug 1145702 - Make the assertion in Axis::GetOverscroll() more informative. r=Cwiiis
authorBotond Ballo <botond@mozilla.com>
Fri, 20 Mar 2015 13:02:23 -0400
changeset 263673 962d3b65774aa7c4028172eb8b954f67e6fd0b83
parent 263672 03453271ff962ed0284adc2be8b3452b30ba702e
child 263674 17eec5f308895e69d8b701081654464bf0ff03e8
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis
bugs1145702
milestone39.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 1145702 - Make the assertion in Axis::GetOverscroll() more informative. r=Cwiiis
gfx/layers/apz/src/Axis.cpp
--- a/gfx/layers/apz/src/Axis.cpp
+++ b/gfx/layers/apz/src/Axis.cpp
@@ -201,17 +201,24 @@ void Axis::OverscrollBy(ParentLayerCoord
   }
   mOverscroll += aOverscroll;
 }
 
 ParentLayerCoord Axis::GetOverscroll() const {
   ParentLayerCoord result = (mOverscroll - mLastOverscrollPeak) / mOverscrollScale;
 
   // Assert that we return overscroll in the correct direction
-  MOZ_ASSERT((result.value * mFirstOverscrollAnimationSample.value) >= 0.0f);
+#ifdef DEBUG
+  if ((result.value * mFirstOverscrollAnimationSample.value) < 0.0f) {
+    nsPrintfCString message("GetOverscroll() (%f) and first overscroll animation sample (%f) have different signs\n",
+                            result.value, mFirstOverscrollAnimationSample.value);
+    NS_ASSERTION(false, message.get());
+    MOZ_CRASH();
+  }
+#endif
 
   return result;
 }
 
 void Axis::StopSamplingOverscrollAnimation() {
   ParentLayerCoord overscroll = GetOverscroll();
   ClearOverscroll();
   mOverscroll = overscroll;