Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #3861

Merged
merged 4 commits into from Feb 18, 2020

Bug 1615091 - Fix panic in resolve_split_planes with invalid transfor…

  • Loading branch information
gw3583 authored and moz-gfx committed Feb 18, 2020
commit c6114b41b9dc64d8a137df07330dabb6b1057b4a
@@ -4778,14 +4778,25 @@ impl PicturePrimitive {
};

let local_points = [
transform.transform_point3d(poly.points[0].cast()).unwrap(),
transform.transform_point3d(poly.points[1].cast()).unwrap(),
transform.transform_point3d(poly.points[2].cast()).unwrap(),
transform.transform_point3d(poly.points[3].cast()).unwrap(),
transform.transform_point3d(poly.points[0].cast()),
transform.transform_point3d(poly.points[1].cast()),
transform.transform_point3d(poly.points[2].cast()),
transform.transform_point3d(poly.points[3].cast()),
];

// If any of the points are un-transformable, just drop this
// plane from drawing.
if local_points.iter().any(|p| p.is_none()) {
continue;
}

let p0 = local_points[0].unwrap();
let p1 = local_points[1].unwrap();
let p2 = local_points[2].unwrap();
let p3 = local_points[3].unwrap();
let gpu_blocks = [
[local_points[0].x, local_points[0].y, local_points[1].x, local_points[1].y].into(),
[local_points[2].x, local_points[2].y, local_points[3].x, local_points[3].y].into(),
[p0.x, p0.y, p1.x, p1.y].into(),
[p2.x, p2.y, p3.x, p3.y].into(),
];
let gpu_handle = gpu_cache.push_per_frame_blocks(&gpu_blocks);
let gpu_address = gpu_cache.get_address(&gpu_handle);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.