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

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

Issue 209303002: Revert "[CSS Shapes] clamp RasterShape shapeMargin to reference box size" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/shapes/RasterShape.h ('k') | Source/core/rendering/shapes/Shape.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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 return result.release(); 249 return result.release();
250 } 250 }
251 251
252 const RasterShapeIntervals& RasterShape::marginIntervals() const 252 const RasterShapeIntervals& RasterShape::marginIntervals() const
253 { 253 {
254 ASSERT(shapeMargin() >= 0); 254 ASSERT(shapeMargin() >= 0);
255 if (!shapeMargin()) 255 if (!shapeMargin())
256 return *m_intervals; 256 return *m_intervals;
257 257
258 int shapeMarginInt = clampToPositiveInteger(ceil(shapeMargin())); 258 int marginBoundaryRadius = std::min(clampToInteger(ceil(shapeMargin())), std ::max(m_imageSize.width(), m_imageSize.height()));
259 int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize. height()) * sqrt(2); 259 if (!m_marginIntervals) {
260 if (!m_marginIntervals) 260 ASSERT(marginBoundaryRadius >= 0);
261 m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(sh apeMarginInt, maxShapeMarginInt)); 261 m_marginIntervals = m_intervals->computeShapeMarginIntervals(marginBound aryRadius);
262 }
262 263
263 return *m_marginIntervals; 264 return *m_marginIntervals;
264 } 265 }
265 266
266 const RasterShapeIntervals& RasterShape::paddingIntervals() const 267 const RasterShapeIntervals& RasterShape::paddingIntervals() const
267 { 268 {
268 ASSERT(shapePadding() >= 0); 269 ASSERT(shapePadding() >= 0);
269 if (!shapePadding()) 270 if (!shapePadding())
270 return *m_intervals; 271 return *m_intervals;
271 272
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool RasterShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalT op, const FloatSize& minLogicalIntervalSize, LayoutUnit& result) const 305 bool RasterShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalT op, const FloatSize& minLogicalIntervalSize, LayoutUnit& result) const
305 { 306 {
306 const RasterShapeIntervals& intervals = paddingIntervals(); 307 const RasterShapeIntervals& intervals = paddingIntervals();
307 if (intervals.isEmpty()) 308 if (intervals.isEmpty())
308 return false; 309 return false;
309 310
310 return intervals.firstIncludedIntervalY(minLogicalIntervalTop.floor(), floor edIntSize(minLogicalIntervalSize), result); 311 return intervals.firstIncludedIntervalY(minLogicalIntervalTop.floor(), floor edIntSize(minLogicalIntervalSize), result);
311 } 312 }
312 313
313 } // namespace WebCore 314 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/RasterShape.h ('k') | Source/core/rendering/shapes/Shape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698