| 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 b59320dcaa719ad9b4f8285df0a6cdf38b6fd002..d1cfda54ca605de0872aeda15cfe37d22655e656 100644
|
| --- a/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
|
| @@ -9,7 +9,6 @@
|
| #include "core/style/NinePieceImage.h"
|
| #include "platform/LengthFunctions.h"
|
| #include "platform/geometry/FloatSize.h"
|
| -#include "platform/geometry/IntSize.h"
|
|
|
| namespace blink {
|
|
|
| @@ -28,7 +27,7 @@ static int computeEdgeSlice(const Length& slice, LayoutUnit maximum)
|
| return std::min<int>(maximum, valueForLength(slice, maximum));
|
| }
|
|
|
| -NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage, IntSize imageSize, IntRect borderImageArea,
|
| +NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage, LayoutSize imageSize, LayoutRect borderImageArea,
|
| const IntRectOutsets& borderWidths)
|
| : m_borderImageArea(borderImageArea)
|
| , m_imageSize(imageSize)
|
| @@ -71,7 +70,7 @@ NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage, Int
|
|
|
| // Given a rectangle, construct a subrectangle using offset, width and height. Negative offsets are relative to the
|
| // extent of the given rectangle.
|
| -static FloatRect subrect(IntRect rect, float offsetX, float offsetY, float width, float height)
|
| +static FloatRect subrect(LayoutRect rect, float offsetX, float offsetY, float width, float height)
|
| {
|
| float baseX = rect.x();
|
| if (offsetX < 0)
|
| @@ -84,9 +83,9 @@ static FloatRect subrect(IntRect rect, float offsetX, float offsetY, float width
|
| return FloatRect(baseX + offsetX, baseY + offsetY, width, height);
|
| }
|
|
|
| -static FloatRect subrect(IntSize size, float offsetX, float offsetY, float width, float height)
|
| +static FloatRect subrect(LayoutSize size, float offsetX, float offsetY, float width, float height)
|
| {
|
| - return subrect(IntRect(IntPoint(), size), offsetX, offsetY, width, height);
|
| + return subrect(LayoutRect(LayoutPoint(), size), offsetX, offsetY, width, height);
|
| }
|
|
|
| static inline void setCornerPiece(NinePieceImageGrid::NinePieceDrawInfo& drawInfo, bool isDrawable,
|
| @@ -156,8 +155,8 @@ static inline void setVerticalEdge(NinePieceImageGrid::NinePieceDrawInfo& drawIn
|
|
|
| void NinePieceImageGrid::setDrawInfoEdge(NinePieceDrawInfo& drawInfo, NinePiece piece) const
|
| {
|
| - IntSize edgeSourceSize = m_imageSize - IntSize(m_left.slice + m_right.slice, m_top.slice + m_bottom.slice);
|
| - IntSize edgeDestinationSize = m_borderImageArea.size() - IntSize(m_left.width + m_right.width, m_top.width + m_bottom.width);
|
| + LayoutSize edgeSourceSize = m_imageSize - LayoutSize(m_left.slice + m_right.slice, m_top.slice + m_bottom.slice);
|
| + LayoutSize edgeDestinationSize = m_borderImageArea.size() - LayoutSize(m_left.width + m_right.width, m_top.width + m_bottom.width);
|
|
|
| switch (piece) {
|
| case LeftPiece:
|
| @@ -192,9 +191,9 @@ void NinePieceImageGrid::setDrawInfoEdge(NinePieceDrawInfo& drawInfo, NinePiece
|
|
|
| void NinePieceImageGrid::setDrawInfoMiddle(NinePieceDrawInfo& drawInfo) const
|
| {
|
| - IntSize sourceSize = m_imageSize - IntSize(m_left.slice + m_right.slice, m_top.slice + m_bottom.slice);
|
| - IntSize destinationSize =
|
| - m_borderImageArea.size() - IntSize(m_left.width + m_right.width, m_top.width + m_bottom.width);
|
| + LayoutSize sourceSize = m_imageSize - LayoutSize(m_left.slice + m_right.slice, m_top.slice + m_bottom.slice);
|
| + LayoutSize destinationSize =
|
| + m_borderImageArea.size() - LayoutSize(m_left.width + m_right.width, m_top.width + m_bottom.width);
|
|
|
| drawInfo.isDrawable = m_fill && !sourceSize.isEmpty() && !destinationSize.isEmpty();
|
| if (!drawInfo.isDrawable)
|
|
|