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

Side by Side Diff: third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO Created 4 years, 10 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 // 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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/SpatialNavigation.h ('k') | third_party/WebKit/Source/core/paint/PaintInfoTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698