Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2681)

Unified Diff: cc/base/math_util.cc

Issue 2627213002: Tighten bounds on 3d clipping. (Closed)
Patch Set: rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/math_util.h ('k') | cc/quads/draw_polygon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/math_util.cc
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index f7ccd43a6a362beb35fa0bf547087d178214a604..c1f2614d110419a4b2cde444487dee87435d3b29 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -178,7 +178,7 @@ static inline bool IsNearlyTheSame(const gfx::Point3F& lhs,
}
static inline void AddVertexToClippedQuad3d(const gfx::Point3F& new_vertex,
- gfx::Point3F clipped_quad[8],
+ gfx::Point3F clipped_quad[6],
int* num_vertices_in_clipped_quad) {
if (*num_vertices_in_clipped_quad > 0 &&
IsNearlyTheSame(clipped_quad[*num_vertices_in_clipped_quad - 1],
@@ -309,7 +309,7 @@ gfx::Rect MathUtil::MapEnclosedRectWith2dAxisAlignedTransform(
bool MathUtil::MapClippedQuad3d(const gfx::Transform& transform,
const gfx::QuadF& src_quad,
- gfx::Point3F clipped_quad[8],
+ gfx::Point3F clipped_quad[6],
int* num_vertices_in_clipped_quad) {
HomogeneousCoordinate h1 =
MapHomogeneousPoint(transform, gfx::Point3F(src_quad.p1()));
@@ -370,7 +370,7 @@ bool MathUtil::MapClippedQuad3d(const gfx::Transform& transform,
clipped_quad[*num_vertices_in_clipped_quad - 1]))
*num_vertices_in_clipped_quad -= 1;
- DCHECK_LE(*num_vertices_in_clipped_quad, 8);
+ DCHECK_LE(*num_vertices_in_clipped_quad, 6);
flackr 2017/01/12 16:59:11 I'm concerned with the DCHECK that if we got this
danakj 2017/01/12 17:01:19 Can we not just find a provably correct number?
return (*num_vertices_in_clipped_quad >= 4);
}
« no previous file with comments | « cc/base/math_util.h ('k') | cc/quads/draw_polygon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698