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

Side by Side Diff: third_party/WebKit/Source/core/layout/shapes/BoxShape.cpp

Issue 2748103015: Replace ASSERT with DCHECK in core/layout/<sub dirs> (Closed)
Patch Set: Rebase with latest 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2013 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (marginBounds.xInterceptsAtY(y1, minXIntercept, maxXIntercept)) { 89 if (marginBounds.xInterceptsAtY(y1, minXIntercept, maxXIntercept)) {
90 x1 = std::min<float>(x1, minXIntercept); 90 x1 = std::min<float>(x1, minXIntercept);
91 x2 = std::max<float>(x2, maxXIntercept); 91 x2 = std::max<float>(x2, maxXIntercept);
92 } 92 }
93 93
94 if (marginBounds.xInterceptsAtY(y2, minXIntercept, maxXIntercept)) { 94 if (marginBounds.xInterceptsAtY(y2, minXIntercept, maxXIntercept)) {
95 x1 = std::min<float>(x1, minXIntercept); 95 x1 = std::min<float>(x1, minXIntercept);
96 x2 = std::max<float>(x2, maxXIntercept); 96 x2 = std::max<float>(x2, maxXIntercept);
97 } 97 }
98 98
99 ASSERT(x2 >= x1); 99 DCHECK_GE(x2, x1);
100 return LineSegment(x1, x2); 100 return LineSegment(x1, x2);
101 } 101 }
102 102
103 void BoxShape::buildDisplayPaths(DisplayPaths& paths) const { 103 void BoxShape::buildDisplayPaths(DisplayPaths& paths) const {
104 paths.shape.addRoundedRect(m_bounds.rect(), m_bounds.getRadii().topLeft(), 104 paths.shape.addRoundedRect(m_bounds.rect(), m_bounds.getRadii().topLeft(),
105 m_bounds.getRadii().topRight(), 105 m_bounds.getRadii().topRight(),
106 m_bounds.getRadii().bottomLeft(), 106 m_bounds.getRadii().bottomLeft(),
107 m_bounds.getRadii().bottomRight()); 107 m_bounds.getRadii().bottomRight());
108 if (shapeMargin()) 108 if (shapeMargin())
109 paths.marginShape.addRoundedRect( 109 paths.marginShape.addRoundedRect(
110 shapeMarginBounds().rect(), shapeMarginBounds().getRadii().topLeft(), 110 shapeMarginBounds().rect(), shapeMarginBounds().getRadii().topLeft(),
111 shapeMarginBounds().getRadii().topRight(), 111 shapeMarginBounds().getRadii().topRight(),
112 shapeMarginBounds().getRadii().bottomLeft(), 112 shapeMarginBounds().getRadii().bottomLeft(),
113 shapeMarginBounds().getRadii().bottomRight()); 113 shapeMarginBounds().getRadii().bottomRight());
114 } 114 }
115 115
116 } // namespace blink 116 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698