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

Unified Diff: Source/core/layout/svg/LayoutSVGShape.h

Issue 1158583003: Reduce how often LayoutSVGShape::updateShapeFromElement is called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix marker regression Created 5 years, 6 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/layout/svg/LayoutSVGShape.h
diff --git a/Source/core/layout/svg/LayoutSVGShape.h b/Source/core/layout/svg/LayoutSVGShape.h
index 2aa5d9cbf143b85dd305597737684ca0617b5acc..79c9bb465bda164bca57f9d44bbdf21b843c0ba7 100644
--- a/Source/core/layout/svg/LayoutSVGShape.h
+++ b/Source/core/layout/svg/LayoutSVGShape.h
@@ -50,6 +50,8 @@ public:
explicit LayoutSVGShape(SVGGeometryElement*);
virtual ~LayoutSVGShape();
+ void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override final;
+
void setNeedsShapeUpdate() { m_needsShapeUpdate = true; }
virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUpdate = true; }
virtual void setNeedsTransformUpdate() override final { m_needsTransformUpdate = true; }
@@ -61,7 +63,6 @@ public:
ASSERT(m_path);
return *m_path;
}
- bool hasPath() const { return m_path.get(); }
virtual bool isShapeEmpty() const { return path().isEmpty(); }
@@ -83,9 +84,12 @@ public:
protected:
void clearPath() { m_path.clear(); }
- void createPath();
+ // Reconstruct the Path. Subclasses may use geometry knowledge to avoid creating a Path.
virtual void updateShapeFromElement();
+
+ virtual void updateStrokeAndFillBoundingBoxes();
+
// Calculates an inclusive bounding box of this shape as if this shape has
// a stroke. If this shape has a stroke, then m_strokeBoundingBox is returned;
// otherwise, estimates a bounding box (not necessarily tight) that would
@@ -112,8 +116,7 @@ private:
virtual bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParent, HitTestAction) override final;
virtual FloatRect strokeBoundingBox() const override final { return m_strokeBoundingBox; }
- FloatRect calculateObjectBoundingBox() const;
- FloatRect calculateStrokeBoundingBox() const;
+
void updatePaintInvalidationBoundingBox();
void updateLocalTransform();

Powered by Google App Engine
This is Rietveld 408576698