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

Unified Diff: third_party/WebKit/Source/platform/graphics/Path.cpp

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: fix typo Created 3 years, 8 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
Index: third_party/WebKit/Source/platform/graphics/Path.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Path.cpp b/third_party/WebKit/Source/platform/graphics/Path.cpp
index 6faaf17e878018b26ea6ba8b53a96ce9ad00eeaf..a47b4cfde71c4728e716029af0c7e224db52250b 100644
--- a/third_party/WebKit/Source/platform/graphics/Path.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Path.cpp
@@ -364,9 +364,12 @@ void Path::AddEllipse(const FloatPoint& p,
float start_angle,
float end_angle,
bool anticlockwise) {
- ASSERT(EllipseIsRenderable(start_angle, end_angle));
- ASSERT(start_angle >= 0 && start_angle < twoPiFloat);
- ASSERT((anticlockwise && (start_angle - end_angle) >= 0) ||
+#if DCHECK_IS_ON()
+ DCHECK(EllipseIsRenderable(start_angle, end_angle));
+#endif
+ DCHECK_GE(start_angle, 0);
+ DCHECK_LT(start_angle, twoPiFloat);
+ DCHECK((anticlockwise && (start_angle - end_angle) >= 0) ||
(!anticlockwise && (end_angle - start_angle) >= 0));
SkScalar cx = WebCoreFloatToSkScalar(p.X());
@@ -425,9 +428,12 @@ void Path::AddEllipse(const FloatPoint& p,
float start_angle,
float end_angle,
bool anticlockwise) {
- ASSERT(EllipseIsRenderable(start_angle, end_angle));
- ASSERT(start_angle >= 0 && start_angle < twoPiFloat);
- ASSERT((anticlockwise && (start_angle - end_angle) >= 0) ||
+#if DCHECK_IS_ON()
+ DCHECK(EllipseIsRenderable(start_angle, end_angle));
+#endif
+ DCHECK_GE(start_angle, 0);
+ DCHECK_LT(start_angle, twoPiFloat);
+ DCHECK((anticlockwise && (start_angle - end_angle) >= 0) ||
(!anticlockwise && (end_angle - start_angle) >= 0));
if (!rotation) {
@@ -439,7 +445,7 @@ void Path::AddEllipse(const FloatPoint& p,
// Add an arc after the relevant transform.
AffineTransform ellipse_transform =
AffineTransform::Translation(p.X(), p.Y()).RotateRadians(rotation);
- ASSERT(ellipse_transform.IsInvertible());
+ DCHECK(ellipse_transform.IsInvertible());
AffineTransform inverse_ellipse_transform = ellipse_transform.Inverse();
Transform(inverse_ellipse_transform);
AddEllipse(FloatPoint::Zero(), radius_x, radius_y, start_angle, end_angle,

Powered by Google App Engine
This is Rietveld 408576698