Bug 1428348: Allow Set{Left,Right,Top,Bottom}Edge methods to compute negative width/height without asserting. r=bas.schouten
authorMilan Sreckovic <milan@mozilla.com>
Tue, 09 Jan 2018 11:24:37 -0500
changeset 452705 fe793fde11177f3e8f3c934c82753e8fbe1b31ed
parent 452704 b51eda5903d55316bbe4a253c65b91a8433f0701
child 452706 f4ff0ac9e058e67c8efd58b27cdec44b44df221f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs1428348
milestone59.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 1428348: Allow Set{Left,Right,Top,Bottom}Edge methods to compute negative width/height without asserting. r=bas.schouten MozReview-Commit-ID: EOGgAvq4lPW
gfx/2d/BaseRect.h
--- a/gfx/2d/BaseRect.h
+++ b/gfx/2d/BaseRect.h
@@ -437,32 +437,28 @@ struct BaseRect {
       case eSideBottom: return YMost();
       case eSideLeft: return X();
     }
     MOZ_CRASH("GFX: Incomplete switch");
   }
 
   // Moves one edge of the rect without moving the opposite edge.
   void SetLeftEdge(T aX) {
-    MOZ_ASSERT(aX <= XMost());
     width = XMost() - aX;
     x = aX;
   }
-  void SetRightEdge(T aXMost) { 
-    MOZ_ASSERT(aXMost >= x);
-    width = aXMost - x; 
+  void SetRightEdge(T aXMost) {
+    width = aXMost - x;
   }
   void SetTopEdge(T aY) {
-    MOZ_ASSERT(aY <= YMost());
     height = YMost() - aY;
     y = aY;
   }
-  void SetBottomEdge(T aYMost) { 
-    MOZ_ASSERT(aYMost >= y);
-    height = aYMost - y; 
+  void SetBottomEdge(T aYMost) {
+    height = aYMost - y;
   }
   void Swap() {
     std::swap(x, y);
     std::swap(width, height);
   }
 
   // Round the rectangle edges to integer coordinates, such that the rounded
   // rectangle has the same set of pixel centers as the original rectangle.