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

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

Issue 601093002: Move SVG container paint code to SVGContainerPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments 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
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 21 matching lines...) Expand all
32 class RenderSVGContainer : public RenderSVGModelObject { 32 class RenderSVGContainer : public RenderSVGModelObject {
33 public: 33 public:
34 explicit RenderSVGContainer(SVGElement*); 34 explicit RenderSVGContainer(SVGElement*);
35 virtual ~RenderSVGContainer(); 35 virtual ~RenderSVGContainer();
36 virtual void trace(Visitor*) override; 36 virtual void trace(Visitor*) override;
37 37
38 // If you have a RenderSVGContainer, use firstChild or lastChild instead. 38 // If you have a RenderSVGContainer, use firstChild or lastChild instead.
39 void slowFirstChild() const WTF_DELETED_FUNCTION; 39 void slowFirstChild() const WTF_DELETED_FUNCTION;
40 void slowLastChild() const WTF_DELETED_FUNCTION; 40 void slowLastChild() const WTF_DELETED_FUNCTION;
41 41
42 RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
43 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
42 44
43 virtual void paint(PaintInfo&, const LayoutPoint&) override; 45 virtual void paint(PaintInfo&, const LayoutPoint&) override;
44 virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUp date = true; } 46 virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUp date = true; }
45 virtual bool didTransformToRootUpdate() { return false; } 47 virtual bool didTransformToRootUpdate() { return false; }
46 bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; } 48 bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; }
47 49
50 virtual FloatRect paintInvalidationRectInLocalCoordinates() const override f inal { return m_paintInvalidationBoundingBox; }
51 bool selfWillPaint();
52
48 protected: 53 protected:
49 virtual RenderObjectChildList* virtualChildren() override final { return chi ldren(); } 54 virtual RenderObjectChildList* virtualChildren() override final { return chi ldren(); }
50 virtual const RenderObjectChildList* virtualChildren() const override final { return children(); } 55 virtual const RenderObjectChildList* virtualChildren() const override final { return children(); }
51 56
52 virtual bool isSVGContainer() const override final { return true; } 57 virtual bool isSVGContainer() const override final { return true; }
53 virtual const char* renderName() const override { return "RenderSVGContainer "; } 58 virtual const char* renderName() const override { return "RenderSVGContainer "; }
54 59
55 virtual void layout() override; 60 virtual void layout() override;
56 61
57 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) ov erride final; 62 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) ov erride final;
58 virtual void removeChild(RenderObject*) override final; 63 virtual void removeChild(RenderObject*) override final;
59 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset, const RenderLayerModelObject* paintContainer) const override final; 64 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset, const RenderLayerModelObject* paintContainer) const override final;
60 65
61 virtual FloatRect objectBoundingBox() const override final { return m_object BoundingBox; } 66 virtual FloatRect objectBoundingBox() const override final { return m_object BoundingBox; }
62 virtual FloatRect strokeBoundingBox() const override final { return m_stroke BoundingBox; } 67 virtual FloatRect strokeBoundingBox() const override final { return m_stroke BoundingBox; }
63 virtual FloatRect paintInvalidationRectInLocalCoordinates() const override f inal { return m_paintInvalidationBoundingBox; }
64 68
65 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F loatPoint& pointInParent, HitTestAction) override; 69 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F loatPoint& pointInParent, HitTestAction) override;
66 70
67 // Allow RenderSVGTransformableContainer to hook in at the right time in lay out() 71 // Allow RenderSVGTransformableContainer to hook in at the right time in lay out().
68 virtual bool calculateLocalTransform() { return false; } 72 virtual bool calculateLocalTransform() { return false; }
69 73
70 // Allow RenderSVGViewportContainer to hook in at the right times in layout( ), paint() and nodeAtFloatPoint() 74 // Allow RenderSVGViewportContainer to hook in at the right times in layout( ) and nodeAtFloatPoint().
71 virtual void calcViewport() { } 75 virtual void calcViewport() { }
72 virtual void applyViewportClip(PaintInfo&) { }
73 virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; } 76 virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
74 77
75 virtual void determineIfLayoutSizeChanged() { } 78 virtual void determineIfLayoutSizeChanged() { }
76 79
77 bool selfWillPaint();
78 void updateCachedBoundaries(); 80 void updateCachedBoundaries();
79 81
80 private: 82 private:
81 RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
82 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
83
84 const RenderObjectChildList* children() const { return &m_children; } 83 const RenderObjectChildList* children() const { return &m_children; }
85 RenderObjectChildList* children() { return &m_children; } 84 RenderObjectChildList* children() { return &m_children; }
86 85
87 RenderObjectChildList m_children; 86 RenderObjectChildList m_children;
88 FloatRect m_objectBoundingBox; 87 FloatRect m_objectBoundingBox;
89 bool m_objectBoundingBoxValid; 88 bool m_objectBoundingBoxValid;
90 FloatRect m_strokeBoundingBox; 89 FloatRect m_strokeBoundingBox;
91 FloatRect m_paintInvalidationBoundingBox; 90 FloatRect m_paintInvalidationBoundingBox;
92 bool m_needsBoundariesUpdate : 1; 91 bool m_needsBoundariesUpdate : 1;
93 }; 92 };
94 93
95 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGContainer, isSVGContainer()); 94 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGContainer, isSVGContainer());
96 95
97 } // namespace blink 96 } // namespace blink
98 97
99 #endif // RenderSVGContainer_h 98 #endif // RenderSVGContainer_h
OLDNEW
« no previous file with comments | « Source/core/paint/SVGContainerPainter.cpp ('k') | Source/core/rendering/svg/RenderSVGContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698