Index: third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
index 76844fb8d94561ee2542d86cc923ad7a799f78c9..50b68837d11559eebdd6cc63fbff019286248fb2 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
@@ -188,6 +188,9 @@ class PLATFORM_EXPORT TransformPaintPropertyNode |
String toString() const; |
+ // Clears all transform caches (see getTransformCache()). |
+ static void clearCache(); |
+ |
private: |
TransformPaintPropertyNode( |
PassRefPtr<const TransformPaintPropertyNode> parent, |
@@ -207,6 +210,31 @@ class PLATFORM_EXPORT TransformPaintPropertyNode |
m_compositorElementId(compositorElementId), |
m_scroll(scroll) {} |
+ struct TransformCacheEntry { |
+ const TransformPaintPropertyNode* ancestorNode; |
+ TransformationMatrix toAncestor; |
+ TransformCacheEntry(const TransformPaintPropertyNode* ancestorNodeArg, |
+ const TransformationMatrix& toAncestorArg) |
+ : ancestorNode(ancestorNodeArg), toAncestor(toAncestorArg) {} |
+ }; |
+ |
+ // For access to getCachedTransform() and setCachedTransform. |
+ friend class GeometryMapper; |
+ friend class GeometryMapperTest; |
+ |
+ Vector<TransformCacheEntry>* getTransformCacheEntries(); |
+ |
+ // Returns the "transformed rect" (see GeometryMapper.h) of |this| in the |
+ // space of |ancestorTransform|, if there is one cached. Otherwise returns |
+ // null. |
+ const TransformationMatrix* getCachedTransform( |
+ const TransformPaintPropertyNode* ancestorTransform) const; |
+ |
+ // Stores the "transformed rect" of |this| in the space of |ancestors|, |
+ // into a local cache. |
+ void setCachedTransform(const TransformPaintPropertyNode* ancestorTransform, |
+ const TransformationMatrix& toAncestor) const; |
+ |
RefPtr<const TransformPaintPropertyNode> m_parent; |
TransformationMatrix m_matrix; |
FloatPoint3D m_origin; |
@@ -215,6 +243,9 @@ class PLATFORM_EXPORT TransformPaintPropertyNode |
CompositingReasons m_directCompositingReasons; |
CompositorElementId m_compositorElementId; |
RefPtr<ScrollPaintPropertyNode> m_scroll; |
+ |
+ std::unique_ptr<Vector<TransformCacheEntry>> m_transformCache; |
+ unsigned m_cacheGeneration; |
}; |
// Redeclared here to avoid ODR issues. |