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

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

Issue 1456813002: Calculate Background Image Geometries using sub-pixel values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MOAR expectations Created 5 years 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 2ffe6a12cd2144d04e9f5e3435a065f92b686bdc..402aed20b53aa622d3d1edf95f8ebac134add22d 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
@@ -48,14 +48,14 @@ bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
// doesn't have any understanding of the zoom that is in effect on the tile.
LayoutRect rectWithOutsets = rect;
rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
- IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets);
+ LayoutRect borderImageRect = rectWithOutsets;
- IntSize imageSize = m_layoutObject.calculateImageIntrinsicDimensions(styleImage, borderImageRect.size(),
- LayoutBoxModelObject::DoNotScaleByEffectiveZoom);
+ IntSize imageSize = roundedIntSize(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, pixelSnappedIntRect(borderImageRect), borderWidths);
RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize, style.effectiveZoom());
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainter.cpp ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698