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

Unified Diff: cc/quads/draw_polygon.cc

Issue 2743283003: Disable Normal DCHECK (Closed)
Patch Set: Move normal copy to initializer. Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_polygon.cc
diff --git a/cc/quads/draw_polygon.cc b/cc/quads/draw_polygon.cc
index 6574196ae0976031b002422978571f191c861adf..43642fa5ea22bea1cf013c81e45bcf11a5a494ce 100644
--- a/cc/quads/draw_polygon.cc
+++ b/cc/quads/draw_polygon.cc
@@ -39,16 +39,17 @@ DrawPolygon::DrawPolygon(const DrawQuad* original,
const std::vector<gfx::Point3F>& in_points,
const gfx::Vector3dF& normal,
int draw_order_index)
- : order_index_(draw_order_index), original_ref_(original), is_split_(true) {
+ : normal_(normal),
+ order_index_(draw_order_index),
+ original_ref_(original),
+ is_split_(true) {
for (size_t i = 0; i < in_points.size(); i++) {
points_.push_back(in_points[i]);
}
-#if DCHECK_IS_ON()
- normal_ = normal;
- ConstructNormal();
- DCHECK_LE((normal_ - normal).Length(), normalized_threshold);
-#endif
- normal_ = normal;
+ // If life was fair, we could recalculate the normal from the given points
+ // and assert it was roughly the same. This causes unhelpful breaks on
+ // trivial slices of split polygons. Similarly, when splitting, it is
+ // better to keep the normal that was constructed from the original.
}
// This takes the original DrawQuad that this polygon should be based on,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698