From 5568e27ddbde0d5d0b7b1982e6ccde769be8d736 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Thu, 14 Mar 2019 11:23:39 +0100 Subject: [PATCH] Bug 1535273 - Remove webrender::util::rect_is_empty. r=kats --- gfx/wr/webrender/src/texture_allocator.rs | 5 ++--- gfx/wr/webrender/src/util.rs | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/gfx/wr/webrender/src/texture_allocator.rs b/gfx/wr/webrender/src/texture_allocator.rs index 5584338ec80e..1f7902b2191e 100644 --- a/gfx/wr/webrender/src/texture_allocator.rs +++ b/gfx/wr/webrender/src/texture_allocator.rs @@ -3,7 +3,6 @@ * 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. @@ -167,10 +166,10 @@ impl ArrayAllocationTracker { } // Add the guillotined rects back to the free list. - if !util::rect_is_empty(&new_free_rect_to_right) { + if !new_free_rect_to_right.is_empty() { self.push(chosen.slice, new_free_rect_to_right); } - if !util::rect_is_empty(&new_free_rect_to_bottom) { + if !new_free_rect_to_bottom.is_empty() { self.push(chosen.slice, new_free_rect_to_bottom); } } diff --git a/gfx/wr/webrender/src/util.rs b/gfx/wr/webrender/src/util.rs index f64811a30f38..8e952e690e80 100644 --- a/gfx/wr/webrender/src/util.rs +++ b/gfx/wr/webrender/src/util.rs @@ -7,7 +7,6 @@ use api::units::*; 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; @@ -416,12 +415,6 @@ impl RectHelpers for TypedRect { } } -// 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(rect: &TypedRect) -> 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 {