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

Side by Side Diff: Source/core/rendering/shapes/RasterShape.cpp

Issue 641643004: Reapply the non-MathExtras parts of (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderText.cpp ('k') | Source/core/rendering/style/CounterDirectives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 y = endY - 1; 135 y = endY - 1;
136 } 136 }
137 } 137 }
138 138
139 const RasterShapeIntervals& RasterShape::marginIntervals() const 139 const RasterShapeIntervals& RasterShape::marginIntervals() const
140 { 140 {
141 ASSERT(shapeMargin() >= 0); 141 ASSERT(shapeMargin() >= 0);
142 if (!shapeMargin()) 142 if (!shapeMargin())
143 return *m_intervals; 143 return *m_intervals;
144 144
145 int shapeMarginInt = clampToPositiveInteger(ceil(shapeMargin())); 145 int shapeMarginInt = clampTo<int>(ceil(shapeMargin()), 0);
146 int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize. height()) * sqrtf(2); 146 int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize. height()) * sqrtf(2);
147 if (!m_marginIntervals) 147 if (!m_marginIntervals)
148 m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(sh apeMarginInt, maxShapeMarginInt)); 148 m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(sh apeMarginInt, maxShapeMarginInt));
149 149
150 return *m_marginIntervals; 150 return *m_marginIntervals;
151 } 151 }
152 152
153 LineSegment RasterShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit l ogicalHeight) const 153 LineSegment RasterShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit l ogicalHeight) const
154 { 154 {
155 const RasterShapeIntervals& intervals = marginIntervals(); 155 const RasterShapeIntervals& intervals = marginIntervals();
(...skipping 17 matching lines...) Expand all
173 excludedInterval.unite(intervals.intervalAt(y)); 173 excludedInterval.unite(intervals.intervalAt(y));
174 } 174 }
175 175
176 // Note: |marginIntervals()| returns end-point exclusive 176 // Note: |marginIntervals()| returns end-point exclusive
177 // intervals. |excludedInterval.x2()| contains the left-most pixel 177 // intervals. |excludedInterval.x2()| contains the left-most pixel
178 // offset to the right of the calculated union. 178 // offset to the right of the calculated union.
179 return LineSegment(excludedInterval.x1(), excludedInterval.x2()); 179 return LineSegment(excludedInterval.x1(), excludedInterval.x2());
180 } 180 }
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderText.cpp ('k') | Source/core/rendering/style/CounterDirectives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698