Backed out 2 changesets (bug 1535273) for webrender bustages CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Fri, 15 Mar 2019 16:00:33 +0200
changeset 522101 9dcc555ea352f0dc8bdf58dc82bf57e4d0bfedd0
parent 522100 ae26f98bfa7c92874a27c9f734fe0f861ac669ad
child 522102 b4485dab99763dafaf707a017ec3eaec43099c9d
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1535273
milestone67.0a1
backs outae26f98bfa7c92874a27c9f734fe0f861ac669ad
df478b79c9b36db774066005f066de5d9909c5d6
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
Backed out 2 changesets (bug 1535273) for webrender bustages CLOSED TREE Backed out changeset ae26f98bfa7c (bug 1535273) Backed out changeset df478b79c9b3 (bug 1535273)
gfx/wr/webrender/src/texture_allocator.rs
gfx/wr/webrender/src/util.rs
--- a/gfx/wr/webrender/src/texture_allocator.rs
+++ b/gfx/wr/webrender/src/texture_allocator.rs
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
+use util;
 
 //TODO: gather real-world statistics on the bin usage in order to assist the decision
 // on where to place the size thresholds.
 
 /// This is an optimization tweak to enable looking through all the free rectangles in a bin
 /// and choosing the smallest, as opposed to picking the first match.
 const FIND_SMALLEST_AREA: bool = false;
 
@@ -161,20 +162,20 @@ impl ArrayAllocationTracker {
                 DeviceIntSize::new(
                     chosen.rect.size.width,
                     candidate_free_rect_to_bottom.size.height,
                 ),
             )
         }
 
         // Add the guillotined rects back to the free list.
-        if !new_free_rect_to_right.is_empty() {
+        if !util::rect_is_empty(&new_free_rect_to_right) {
             self.push(chosen.slice, new_free_rect_to_right);
         }
-        if !new_free_rect_to_bottom.is_empty() {
+        if !util::rect_is_empty(&new_free_rect_to_bottom) {
             self.push(chosen.slice, new_free_rect_to_bottom);
         }
     }
 
     pub fn allocate(
         &mut self, requested_dimensions: &DeviceIntSize
     ) -> Option<(FreeRectSlice, DeviceIntPoint)> {
         if requested_dimensions.width == 0 || requested_dimensions.height == 0 {
--- a/gfx/wr/webrender/src/util.rs
+++ b/gfx/wr/webrender/src/util.rs
@@ -1,17 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::BorderRadius;
 use api::units::*;
-use euclid::{TypedPoint2D, TypedRect, TypedSize2D, Vector2D};
+use euclid::{Point2D, Rect, Size2D, TypedPoint2D, TypedRect, TypedSize2D, Vector2D};
 use euclid::{TypedTransform2D, TypedTransform3D, TypedVector2D, TypedScale};
 use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
+use num_traits::Zero;
 use plane_split::{Clipper, Polygon};
 use std::{i32, f32, fmt, ptr};
 use std::borrow::Cow;
 use std::os::raw::c_void;
 use std::sync::Arc;
 use std::mem::replace;
 
 
@@ -409,16 +410,22 @@ impl<U> RectHelpers<U> for TypedRect<f32
         )
     }
 
     fn is_well_formed_and_nonempty(&self) -> bool {
         self.size.width > 0.0 && self.size.height > 0.0
     }
 }
 
+// Don't use `euclid`'s `is_empty` because that has effectively has an "and" in the conditional
+// below instead of an "or".
+pub fn rect_is_empty<N: PartialEq + Zero, U>(rect: &TypedRect<N, U>) -> bool {
+    rect.size.width == Zero::zero() || rect.size.height == Zero::zero()
+}
+
 #[allow(dead_code)]
 #[inline]
 pub fn rect_from_points_f(x0: f32, y0: f32, x1: f32, y1: f32) -> Rect<f32> {
     Rect::new(Point2D::new(x0, y0), Size2D::new(x1 - x0, y1 - y0))
 }
 
 pub fn lerp(a: f32, b: f32, t: f32) -> f32 {
     (b - a) * t + a