Commit fd748468 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Remove unused "clamped" out-param from TransformationMatrix::ProjectQuad

The value of clamped was never used and we can remove it to save some
branching.

Change-Id: I7f041ed5762782d0073a225e09285a6d99a5cdb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2445850
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Auto-Submit: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813239}
parent 177aca2d
...@@ -845,8 +845,7 @@ FloatPoint TransformationMatrix::ProjectPoint(const FloatPoint& p, ...@@ -845,8 +845,7 @@ FloatPoint TransformationMatrix::ProjectPoint(const FloatPoint& p,
return FloatPoint(static_cast<float>(out_x), static_cast<float>(out_y)); return FloatPoint(static_cast<float>(out_x), static_cast<float>(out_y));
} }
FloatQuad TransformationMatrix::ProjectQuad(const FloatQuad& q, FloatQuad TransformationMatrix::ProjectQuad(const FloatQuad& q) const {
bool* clamped) const {
FloatQuad projected_quad; FloatQuad projected_quad;
bool clamped1 = false; bool clamped1 = false;
...@@ -859,9 +858,6 @@ FloatQuad TransformationMatrix::ProjectQuad(const FloatQuad& q, ...@@ -859,9 +858,6 @@ FloatQuad TransformationMatrix::ProjectQuad(const FloatQuad& q,
projected_quad.SetP3(ProjectPoint(q.P3(), &clamped3)); projected_quad.SetP3(ProjectPoint(q.P3(), &clamped3));
projected_quad.SetP4(ProjectPoint(q.P4(), &clamped4)); projected_quad.SetP4(ProjectPoint(q.P4(), &clamped4));
if (clamped)
*clamped = clamped1 || clamped2 || clamped3 || clamped4;
// If all points on the quad had w < 0, then the entire quad would not be // If all points on the quad had w < 0, then the entire quad would not be
// visible to the projected surface. // visible to the projected surface.
bool everything_was_clipped = clamped1 && clamped2 && clamped3 && clamped4; bool everything_was_clipped = clamped1 && clamped2 && clamped3 && clamped4;
......
...@@ -215,14 +215,13 @@ class PLATFORM_EXPORT TransformationMatrix { ...@@ -215,14 +215,13 @@ class PLATFORM_EXPORT TransformationMatrix {
// dropped, effectively projecting the quad into the z=0 plane // dropped, effectively projecting the quad into the z=0 plane
FloatQuad MapQuad(const FloatQuad&) const; FloatQuad MapQuad(const FloatQuad&) const;
// Map a point on the z=0 plane into a point on // Map a point on the z=0 plane into a point on the plane with with the
// the plane with with the transform applied, by extending // transform applied, by extending a ray perpendicular to the source plane and
// a ray perpendicular to the source plane and computing // computing the local x,y position of the point where that ray intersects
// the local x,y position of the point where that ray intersects
// with the destination plane. // with the destination plane.
FloatPoint ProjectPoint(const FloatPoint&, bool* clamped = nullptr) const; FloatPoint ProjectPoint(const FloatPoint&, bool* clamped = nullptr) const;
// Projects the four corners of the quad // Projects the four corners of the quad.
FloatQuad ProjectQuad(const FloatQuad&, bool* clamped = nullptr) const; FloatQuad ProjectQuad(const FloatQuad&) const;
// Projects the four corners of the quad and takes a bounding box, // Projects the four corners of the quad and takes a bounding box,
// while sanitizing values created when the w component is negative. // while sanitizing values created when the w component is negative.
LayoutRect ClampedBoundsOfProjectedQuad(const FloatQuad&) const; LayoutRect ClampedBoundsOfProjectedQuad(const FloatQuad&) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment