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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h

Issue 2565943002: Add support for caching and invalidating SVG marker transforms (Closed)
Patch Set: rebase Created 4 years 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: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h
index 63fe310a93dcbe641572dbdfb18e76fc79887998..bf5def66dc047708ef6f1d05e8a166f54867ed4d 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h
@@ -42,11 +42,19 @@ class LayoutSVGResourceMarker final : public LayoutSVGResourceContainer {
// Calculates marker boundaries, mapped to the target element's coordinate
// space.
FloatRect markerBoundaries(const AffineTransform& markerTransformation) const;
-
- AffineTransform localToSVGParentTransform() const override;
AffineTransform markerTransformation(const FloatPoint& origin,
float angle,
float strokeWidth) const;
+
+ AffineTransform localToSVGParentTransform() const final {
+ return m_localToParentTransform;
+ }
+ void setNeedsTransformUpdate() final;
+
+ // The viewport origin is (0,0) and not the reference point because each
+ // marker instance includes the reference in markerTransformation().
+ FloatRect viewport() const { return FloatRect(FloatPoint(), m_viewportSize); }
+
bool shouldPaint() const;
FloatPoint referencePoint() const;
@@ -54,21 +62,16 @@ class LayoutSVGResourceMarker final : public LayoutSVGResourceContainer {
SVGMarkerUnitsType markerUnits() const;
SVGMarkerOrientType orientType() const;
- // The viewport origin is (0,0) and not the reference point because each
- // marker instance includes the reference in markerTransformation().
- FloatRect viewport() const { return FloatRect(FloatPoint(), m_viewportSize); }
-
static const LayoutSVGResourceType s_resourceType = MarkerResourceType;
LayoutSVGResourceType resourceType() const override { return s_resourceType; }
private:
void layout() override;
- void calcViewport() override;
- SVGTransformChange calculateLocalTransform() override;
-
- AffineTransform viewportTransform() const;
+ SVGTransformChange calculateLocalTransform() final;
+ AffineTransform m_localToParentTransform;
FloatSize m_viewportSize;
+ bool m_needsTransformUpdate;
};
DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceMarker,
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698