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

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

Issue 2238853005: Use GeometryMapper in PaintInvalidator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@GeometryMapperMore
Patch Set: Rebase Created 4 years, 4 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/SVGRootPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
index 14781968a9586066b8e4fc87adf5483ef4b190d7..b4a2d1f996b8e64e4f8440f54ae7e05dea6c6950 100644
--- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -28,9 +28,12 @@ AffineTransform SVGRootPainter::transformToPixelSnappedBorderBox(const LayoutPoi
const IntRect snappedSize = pixelSnappedSize(paintOffset);
AffineTransform paintOffsetToBorderBox =
AffineTransform::translation(snappedSize.x(), snappedSize.y());
- paintOffsetToBorderBox.scale(
- snappedSize.width() / m_layoutSVGRoot.size().width().toFloat(),
- snappedSize.height() / m_layoutSVGRoot.size().height().toFloat());
+ LayoutSize size = m_layoutSVGRoot.size();
+ if (!size.isEmpty()) {
+ paintOffsetToBorderBox.scale(
+ snappedSize.width() / size.width().toFloat(),
+ snappedSize.height() / size.height().toFloat());
+ }
paintOffsetToBorderBox.multiply(m_layoutSVGRoot.localToBorderBoxTransform());
return paintOffsetToBorderBox;
}

Powered by Google App Engine
This is Rietveld 408576698