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

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

Issue 2128463002: Pixel snap SVG's root border box to local transform [spv2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename to transformToPixelSnappedBorderBox, improve comments Created 4 years, 5 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.h
diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.h b/third_party/WebKit/Source/core/paint/SVGRootPainter.h
index 0c8f74f61c2b7de418dfd785c07ca2d0876b5683..b11acdd0934fb64640fbdb0ac9a08d33c2bbc3dc 100644
--- a/third_party/WebKit/Source/core/paint/SVGRootPainter.h
+++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.h
@@ -10,6 +10,8 @@
namespace blink {
struct PaintInfo;
+class AffineTransform;
+class IntRect;
class LayoutPoint;
class LayoutSVGRoot;
@@ -20,7 +22,14 @@ public:
void paint(const PaintInfo&, const LayoutPoint&);
+ // The embedded SVG document uses an unsnapped viewport box for layout, while SVG root's border
+ // box ultimately gets snapped during paint. This translate/scale transform is applied to
+ // compensate the difference, in addition to applying the local to border box transform.
+ AffineTransform transformToPixelSnappedBorderBox(const LayoutPoint& paintOffset) const;
+
private:
+ IntRect pixelSnappedSize(const LayoutPoint& paintOffset) const;
+
const LayoutSVGRoot& m_layoutSVGRoot;
};
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.h ('k') | third_party/WebKit/Source/core/paint/SVGRootPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698