| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/NinePieceImageGrid.h" | 5 #include "core/paint/NinePieceImageGrid.h" |
| 6 | 6 |
| 7 #include "core/style/ComputedStyle.h" | 7 #include "core/style/ComputedStyle.h" |
| 8 #include "core/style/NinePieceImage.h" | 8 #include "core/style/NinePieceImage.h" |
| 9 #include "platform/LengthFunctions.h" | 9 #include "platform/LengthFunctions.h" |
| 10 #include "platform/geometry/FloatSize.h" | 10 #include "platform/geometry/FloatSize.h" |
| 11 #include "platform/geometry/IntSize.h" | 11 #include "platform/geometry/IntSize.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 static LayoutUnit computeEdgeWidth(const BorderImageLength& borderSlice, int bor
derSide, const LayoutUnit& imageSide, | 15 static int computeEdgeWidth(const BorderImageLength& borderSlice, int borderSide
, const LayoutUnit& imageSide, |
| 16 const LayoutUnit& boxExtent) | 16 const LayoutUnit& boxExtent) |
| 17 { | 17 { |
| 18 if (borderSlice.isNumber()) | 18 if (borderSlice.isNumber()) |
| 19 return borderSlice.number() * borderSide; | 19 return borderSlice.number() * borderSide; |
| 20 if (borderSlice.length().isAuto()) | 20 if (borderSlice.length().isAuto()) |
| 21 return imageSide; | 21 return imageSide; |
| 22 return valueForLength(borderSlice.length(), boxExtent); | 22 return valueForLength(borderSlice.length(), boxExtent); |
| 23 } | 23 } |
| 24 | 24 |
| 25 static int computeEdgeSlice(const Length& slice, LayoutUnit maximum) | 25 static int computeEdgeSlice(const Length& slice, LayoutUnit maximum) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 setDrawInfoCorner(drawInfo, piece); | 240 setDrawInfoCorner(drawInfo, piece); |
| 241 else if (piece != MiddlePiece) | 241 else if (piece != MiddlePiece) |
| 242 setDrawInfoEdge(drawInfo, piece); | 242 setDrawInfoEdge(drawInfo, piece); |
| 243 else | 243 else |
| 244 setDrawInfoMiddle(drawInfo); | 244 setDrawInfoMiddle(drawInfo); |
| 245 | 245 |
| 246 return drawInfo; | 246 return drawInfo; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace blink | 249 } // namespace blink |
| OLD | NEW |