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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h

Issue 2672993004: Fix clip caching bug in GeometryMapper. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
index ee992e3d4ecfb6a95250ecbbfb834c1e16ef96b1..390cdc498cee7be1cc7481400b220441b3017882 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
@@ -12,19 +12,26 @@
namespace blink {
+// Maps from a descendant clip node to its equivalent "clip visual rect" in
+// the space of the ancestor. The clip visual rect is defined as the
+// intersection of all clips between the descendant and the ancestor (*not*
+// including the ancestor) in the clip tree, individually transformed from
+// their localTransformSpace into the ancestor's localTransformSpace.
+typedef HashMap<const ClipPaintPropertyNode*, FloatRect> ClipCache;
+
+// Maps from a transform node that is a descendant of the ancestor to the
+// combined transform between the descendant's and the ancestor's coordinate
+typedef HashMap<const TransformPaintPropertyNode*, TransformationMatrix>
+ TransformCache;
+
struct PrecomputedDataForAncestor {
- // Maps from a transform node that is a descendant of the ancestor to the
- // combined transform between the descendant's and the ancestor's coordinate
- // space.
- HashMap<const TransformPaintPropertyNode*, TransformationMatrix>
- toAncestorTransforms;
-
- // Maps from a descendant clip node to its equivalent "clip visual rect" in
- // the space of the ancestor. The clip visual rect is defined as the
- // intersection of all clips between the descendant and the ancestor (*not*
- // including the ancestor) in the clip tree, individually transformed from
- // their localTransformSpace into the ancestor's localTransformSpace.
- HashMap<const ClipPaintPropertyNode*, FloatRect> toAncestorClipRects;
+ TransformCache toAncestorTransforms;
+
+ // There can be multiple clips within the same transform space. This
+ // maps from the desired destination clip within the same transform
+ // space to its corresponding ClipCache.
+ HashMap<const ClipPaintPropertyNode*, std::unique_ptr<ClipCache>>
+ precomputedClips;
static std::unique_ptr<PrecomputedDataForAncestor> create() {
return WTF::makeUnique<PrecomputedDataForAncestor>();
@@ -173,6 +180,13 @@ class PLATFORM_EXPORT GeometryMapper {
PrecomputedDataForAncestor& getPrecomputedDataForAncestor(
const TransformPaintPropertyNode*);
+ // Returns the transform cache for the given ancestor transform node.
+ TransformCache& getTransformCache(const TransformPaintPropertyNode*);
+
+ // Returns the clip cache for the given ancestor clip node.
+ ClipCache& getClipCache(const TransformPaintPropertyNode*,
+ const ClipPaintPropertyNode*);
+
friend class GeometryMapperTest;
friend class PaintLayerClipperTest;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698