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

Side by Side Diff: Source/core/rendering/svg/RenderSVGRoot.h

Issue 666163005: Factor SVG root painter code into SVGRootPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/SVGRootPainter.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. All rights reserved. 4 * Copyright (C) 2009 Google, Inc. All rights reserved.
5 * Copyright (C) 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2009 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 26 matching lines...) Expand all
37 37
38 bool isEmbeddedThroughSVGImage() const; 38 bool isEmbeddedThroughSVGImage() const;
39 bool isEmbeddedThroughFrameContainingSVGDocument() const; 39 bool isEmbeddedThroughFrameContainingSVGDocument() const;
40 40
41 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub le& intrinsicRatio) const override; 41 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub le& intrinsicRatio) const override;
42 42
43 // If you have a RenderSVGRoot, use firstChild or lastChild instead. 43 // If you have a RenderSVGRoot, use firstChild or lastChild instead.
44 void slowFirstChild() const WTF_DELETED_FUNCTION; 44 void slowFirstChild() const WTF_DELETED_FUNCTION;
45 void slowLastChild() const WTF_DELETED_FUNCTION; 45 void slowLastChild() const WTF_DELETED_FUNCTION;
46 46
47 RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
48 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
49
47 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } 50 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
48 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransf ormUpdate = true; } 51 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransf ormUpdate = true; }
49 virtual void setNeedsTransformUpdate() override { m_needsBoundariesOrTransfo rmUpdate = true; } 52 virtual void setNeedsTransformUpdate() override { m_needsBoundariesOrTransfo rmUpdate = true; }
50 53
51 IntSize containerSize() const { return m_containerSize; } 54 IntSize containerSize() const { return m_containerSize; }
52 void setContainerSize(const IntSize& containerSize) 55 void setContainerSize(const IntSize& containerSize)
53 { 56 {
54 // SVGImage::draw() does a view layout prior to painting, 57 // SVGImage::draw() does a view layout prior to painting,
55 // and we need that layout to know of the new size otherwise 58 // and we need that layout to know of the new size otherwise
56 // the rendering may be incorrectly using the old size. 59 // the rendering may be incorrectly using the old size.
57 if (m_containerSize != containerSize) 60 if (m_containerSize != containerSize)
58 setNeedsLayoutAndFullPaintInvalidation(); 61 setNeedsLayoutAndFullPaintInvalidation();
59 m_containerSize = containerSize; 62 m_containerSize = containerSize;
60 } 63 }
61 64
62 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates. 65 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates.
63 const AffineTransform& localToBorderBoxTransform() const { return m_localToB orderBoxTransform; } 66 const AffineTransform& localToBorderBoxTransform() const { return m_localToB orderBoxTransform; }
64 bool shouldApplyViewportClip() const; 67 bool shouldApplyViewportClip() const;
65 68
69
70
66 private: 71 private:
67 RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
68 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
69
70 const RenderObjectChildList* children() const { return &m_children; } 72 const RenderObjectChildList* children() const { return &m_children; }
71 RenderObjectChildList* children() { return &m_children; } 73 RenderObjectChildList* children() { return &m_children; }
72 74
73 virtual RenderObjectChildList* virtualChildren() override { return children( ); } 75 virtual RenderObjectChildList* virtualChildren() override { return children( ); }
74 virtual const RenderObjectChildList* virtualChildren() const override { retu rn children(); } 76 virtual const RenderObjectChildList* virtualChildren() const override { retu rn children(); }
75 77
76 virtual const char* renderName() const override { return "RenderSVGRoot"; } 78 virtual const char* renderName() const override { return "RenderSVGRoot"; }
77 virtual bool isOfType(RenderObjectType type) const override { return type == RenderObjectSVG || type == RenderObjectSVGRoot || RenderReplaced::isOfType(type ); } 79 virtual bool isOfType(RenderObjectType type) const override { return type == RenderObjectSVG || type == RenderObjectSVGRoot || RenderReplaced::isOfType(type ); }
78 80
79 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const override; 81 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const override;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 bool m_isLayoutSizeChanged : 1; 124 bool m_isLayoutSizeChanged : 1;
123 bool m_needsBoundariesOrTransformUpdate : 1; 125 bool m_needsBoundariesOrTransformUpdate : 1;
124 bool m_hasBoxDecorationBackground : 1; 126 bool m_hasBoxDecorationBackground : 1;
125 }; 127 };
126 128
127 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); 129 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot());
128 130
129 } // namespace blink 131 } // namespace blink
130 132
131 #endif // RenderSVGRoot_h 133 #endif // RenderSVGRoot_h
OLDNEW
« no previous file with comments | « Source/core/paint/SVGRootPainter.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698