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

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

Issue 1704493002: Use Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-image-updateconcretesize
Patch Set: Move test here from dependency CL. 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 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 9eed86d02b541b99be1b3cdd22ad4ae6e603c2e2..a917e1d6f54249e0624581c385f76e6be83222b7 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
@@ -49,9 +49,11 @@ bool NinePieceImagePainter::paint(GraphicsContext& graphicsContext, const Layout
rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
LayoutRect borderImageRect = rectWithOutsets;
- IntSize imageSize = roundedIntSize(m_layoutObject.calculateImageIntrinsicDimensions(styleImage, borderImageRect.size(),
- LayoutBoxModelObject::DoNotScaleByEffectiveZoom));
+ LayoutSize defaultObjectSize = borderImageRect.size();
+ defaultObjectSize.scale(1 / style.effectiveZoom());
+ styleImage->updateConcreteObjectSize(defaultObjectSize);
+ IntSize imageSize = roundedIntSize(styleImage->imageSize(&m_layoutObject, style.effectiveZoom()));
IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth(),
style.borderBottomWidth(), style.borderLeftWidth());
NinePieceImageGrid grid(ninePieceImage, imageSize, pixelSnappedIntRect(borderImageRect), borderWidths);

Powered by Google App Engine
This is Rietveld 408576698