зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1535273 - Remove webrender::util::rect_is_empty. r=kats
This commit is contained in:
Родитель
b068fc3d17
Коммит
5568e27ddb
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<U> RectHelpers<U> for TypedRect<f32, U> {
|
|||
}
|
||||
}
|
||||
|
||||
// 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> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче