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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp

Issue 2846303002: Replace ASSERT with DCHECK in platform/ (Closed)
Patch Set: rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 float max_y, 156 float max_y,
157 Vector<const FloatPolygonEdge*>& result) const { 157 Vector<const FloatPolygonEdge*>& result) const {
158 Vector<FloatPolygon::EdgeInterval> overlapping_edge_intervals; 158 Vector<FloatPolygon::EdgeInterval> overlapping_edge_intervals;
159 edge_tree_.AllOverlaps(FloatPolygon::EdgeInterval(min_y, max_y, 0), 159 edge_tree_.AllOverlaps(FloatPolygon::EdgeInterval(min_y, max_y, 0),
160 overlapping_edge_intervals); 160 overlapping_edge_intervals);
161 unsigned overlapping_edge_intervals_size = overlapping_edge_intervals.size(); 161 unsigned overlapping_edge_intervals_size = overlapping_edge_intervals.size();
162 result.resize(overlapping_edge_intervals_size); 162 result.resize(overlapping_edge_intervals_size);
163 for (unsigned i = 0; i < overlapping_edge_intervals_size; ++i) { 163 for (unsigned i = 0; i < overlapping_edge_intervals_size; ++i) {
164 const FloatPolygonEdge* edge = static_cast<const FloatPolygonEdge*>( 164 const FloatPolygonEdge* edge = static_cast<const FloatPolygonEdge*>(
165 overlapping_edge_intervals[i].Data()); 165 overlapping_edge_intervals[i].Data());
166 ASSERT(edge); 166 DCHECK(edge);
167 result[i] = edge; 167 result[i] = edge;
168 } 168 }
169 return overlapping_edge_intervals_size > 0; 169 return overlapping_edge_intervals_size > 0;
170 } 170 }
171 171
172 static inline float LeftSide(const FloatPoint& vertex1, 172 static inline float LeftSide(const FloatPoint& vertex1,
173 const FloatPoint& vertex2, 173 const FloatPoint& vertex2,
174 const FloatPoint& point) { 174 const FloatPoint& point) {
175 return ((point.X() - vertex1.X()) * (vertex2.Y() - vertex1.Y())) - 175 return ((point.X() - vertex1.X()) * (vertex2.Y() - vertex1.Y())) -
176 ((vertex2.X() - vertex1.X()) * (point.Y() - vertex1.Y())); 176 ((vertex2.X() - vertex1.X()) * (point.Y() - vertex1.Y()));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 if (u_this_line < 0 || u_other_line < 0 || u_this_line > 1 || 241 if (u_this_line < 0 || u_other_line < 0 || u_this_line > 1 ||
242 u_other_line > 1) 242 u_other_line > 1)
243 return false; 243 return false;
244 244
245 point = Vertex1() + u_this_line * this_delta; 245 point = Vertex1() + u_this_line * this_delta;
246 return true; 246 return true;
247 } 247 }
248 248
249 } // namespace blink 249 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698