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

Unified Diff: third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp

Issue 2640143005: Support subpixel layout for borders. (Closed)
Patch Set: Rebaselined tests. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
diff --git a/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
index 6212642cada8bfb2383a3532d4e93c71c47b586e..087128fc5512398504e76608a9ce74fdfcf0309c 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
@@ -17,15 +17,15 @@ static int computeEdgeWidth(const BorderImageLength& borderSlice,
int imageSide,
int boxExtent) {
if (borderSlice.isNumber())
- return borderSlice.number() * borderSide;
+ return roundf(borderSlice.number() * borderSide);
if (borderSlice.length().isAuto())
return imageSide;
- return valueForLength(borderSlice.length(), LayoutUnit(boxExtent)).toInt();
+ return valueForLength(borderSlice.length(), LayoutUnit(boxExtent)).round();
}
static int computeEdgeSlice(const Length& slice, int maximum) {
return std::min<int>(maximum,
- valueForLength(slice, LayoutUnit(maximum)).toInt());
+ valueForLength(slice, LayoutUnit(maximum)).round());
}
NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage,

Powered by Google App Engine
This is Rietveld 408576698