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

Unified Diff: Source/core/rendering/svg/RenderSVGResourceLinearGradient.h

Issue 869323003: Oilpan: move RenderObjects off heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements Created 5 years, 10 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: Source/core/rendering/svg/RenderSVGResourceLinearGradient.h
diff --git a/Source/core/rendering/svg/RenderSVGResourceLinearGradient.h b/Source/core/rendering/svg/RenderSVGResourceLinearGradient.h
index cca389f473f4c9c577de94edc5644a71188f018e..aec63021fd78c17c49be0c261d80aa878d9c8812 100644
--- a/Source/core/rendering/svg/RenderSVGResourceLinearGradient.h
+++ b/Source/core/rendering/svg/RenderSVGResourceLinearGradient.h
@@ -38,18 +38,30 @@ public:
static const RenderSVGResourceType s_resourceType = LinearGradientResourceType;
virtual RenderSVGResourceType resourceType() const override { return s_resourceType; }
- virtual SVGUnitTypes::SVGUnitType gradientUnits() const override { return m_attributes.gradientUnits(); }
- virtual void calculateGradientTransform(AffineTransform& transform) override { transform = m_attributes.gradientTransform(); }
+ virtual SVGUnitTypes::SVGUnitType gradientUnits() const override { return attributes().gradientUnits(); }
+ virtual void calculateGradientTransform(AffineTransform& transform) override { transform = attributes().gradientTransform(); }
virtual bool collectGradientAttributes(SVGGradientElement*) override;
virtual void buildGradient(GradientData*) const override;
FloatPoint startPoint(const LinearGradientAttributes&) const;
FloatPoint endPoint(const LinearGradientAttributes&) const;
- virtual void trace(Visitor*) override;
-
private:
+#if ENABLE(OILPAN)
+ // FIXME: Oilpan: the RenderObject hierarchy isn't on the heap, but
+ // the SVG property hierarchy is. And the two meet here, so keep a
+ // persistent reference to the SVG part object by way of a heap-allocated
+ // wrapper object.
+ Persistent<LinearGradientAttributesWrapper> m_attributesWrapper;
+
+ LinearGradientAttributes& mutableAttributes() { return m_attributesWrapper->attributes(); }
+ const LinearGradientAttributes& attributes() const { return m_attributesWrapper->attributes(); }
+#else
LinearGradientAttributes m_attributes;
+
+ LinearGradientAttributes& mutableAttributes() { return m_attributes; }
+ const LinearGradientAttributes& attributes() const { return m_attributes; }
+#endif
};
} // namespace blink
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilter.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698