Bug 1562869 - Check for NaNs in project_rect. r=aosmond
authorNicolas Silva <nsilva@mozilla.com>
Fri, 30 Aug 2019 11:27:40 +0000
changeset 554646 9a59db93153408008285cac6cb17bf9d84b86aca
parent 554645 d116943004375716e43e6863d8a4b375821c7eaa
child 554647 274f8d9b14b6eb32368010c386a59c16fcc6ccc4
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1562869
milestone70.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 1562869 - Check for NaNs in project_rect. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D44114
gfx/wr/webrender/src/util.rs
--- a/gfx/wr/webrender/src/util.rs
+++ b/gfx/wr/webrender/src/util.rs
@@ -820,17 +820,17 @@ pub fn project_rect<F, T>(
         transform.transform_point2d_homogeneous(rect.origin),
         transform.transform_point2d_homogeneous(rect.top_right()),
         transform.transform_point2d_homogeneous(rect.bottom_left()),
         transform.transform_point2d_homogeneous(rect.bottom_right()),
     ];
 
     // Note: we only do the full frustum collision when the polygon approaches the camera plane.
     // Otherwise, it will be clamped to the screen bounds anyway.
-    if homogens.iter().any(|h| h.w <= 0.0) {
+    if homogens.iter().any(|h| h.w <= 0.0 || h.w.is_nan()) {
         let mut clipper = Clipper::new();
         let polygon = Polygon::from_rect(*rect, 1);
 
         let planes = match Clipper::frustum_planes(
             transform,
             Some(*bounds),
         ) {
             Ok(planes) => planes,