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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SVGRootPainter_h 5 #ifndef SVGRootPainter_h
6 #define SVGRootPainter_h 6 #define SVGRootPainter_h
7 7
8 #include "wtf/Allocator.h" 8 #include "wtf/Allocator.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 struct PaintInfo; 12 struct PaintInfo;
13 class AffineTransform;
14 class IntRect;
13 class LayoutPoint; 15 class LayoutPoint;
14 class LayoutSVGRoot; 16 class LayoutSVGRoot;
15 17
16 class SVGRootPainter { 18 class SVGRootPainter {
17 STACK_ALLOCATED(); 19 STACK_ALLOCATED();
18 public: 20 public:
19 SVGRootPainter(const LayoutSVGRoot& layoutSVGRoot) : m_layoutSVGRoot(layoutS VGRoot) { } 21 SVGRootPainter(const LayoutSVGRoot& layoutSVGRoot) : m_layoutSVGRoot(layoutS VGRoot) { }
20 22
21 void paint(const PaintInfo&, const LayoutPoint&); 23 void paint(const PaintInfo&, const LayoutPoint&);
22 24
25 // The embedded SVG document uses an unsnapped viewport box for layout, whil e SVG root's border
26 // box ultimately gets snapped during paint. This translate/scale transform is applied to
27 // compensate the difference, in addition to applying the local to border bo x transform.
28 AffineTransform transformToPixelSnappedBorderBox(const LayoutPoint& paintOff set) const;
29
23 private: 30 private:
31 IntRect pixelSnappedSize(const LayoutPoint& paintOffset) const;
32
24 const LayoutSVGRoot& m_layoutSVGRoot; 33 const LayoutSVGRoot& m_layoutSVGRoot;
25 }; 34 };
26 35
27 } // namespace blink 36 } // namespace blink
28 37
29 #endif // SVGRootPainter_h 38 #endif // SVGRootPainter_h
OLDNEW
« 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