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

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

Issue 1477813002: Move NinePieceImageGrid to LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to trunk for bot bouncing Created 5 years, 1 month 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/NinePieceImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
index afd882d68dbbdf202c41b862f7eadeed0d6d660e..0fec3ad166bbfa39d3704223fc63da82c730098d 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
@@ -50,14 +50,14 @@ bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets);
- IntSize imageSize = m_layoutObject.calculateImageIntrinsicDimensions(styleImage, borderImageRect.size(),
- LayoutBoxModelObject::DoNotScaleByEffectiveZoom);
+ LayoutSize imageSize(m_layoutObject.calculateImageIntrinsicDimensions(styleImage, borderImageRect.size(),
+ LayoutBoxModelObject::DoNotScaleByEffectiveZoom));
IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth(),
style.borderBottomWidth(), style.borderLeftWidth());
- NinePieceImageGrid grid(ninePieceImage, imageSize, borderImageRect, borderWidths);
+ NinePieceImageGrid grid(ninePieceImage, imageSize, LayoutRect(borderImageRect), borderWidths);
- RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize, style.effectiveZoom());
+ RefPtr<Image> image = styleImage->image(&m_layoutObject, roundedIntSize(imageSize), style.effectiveZoom());
InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQuality(m_layoutObject,
graphicsContext, image.get(), 0, rectWithOutsets.size());
@@ -74,8 +74,8 @@ bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
if (drawInfo.isCornerPiece) {
graphicsContext->drawImage(image.get(), drawInfo.destination, drawInfo.source, op);
} else {
- graphicsContext->drawTiledImage(image.get(), enclosingIntRect(drawInfo.destination),
- enclosingIntRect(drawInfo.source), drawInfo.tileScale, drawInfo.tileRule.horizontal,
+ graphicsContext->drawTiledImage(image.get(), drawInfo.destination,
+ drawInfo.source, drawInfo.tileScale, drawInfo.tileRule.horizontal,
drawInfo.tileRule.vertical, op);
}
}

Powered by Google App Engine
This is Rietveld 408576698