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

Side by Side Diff: third_party/WebKit/Source/core/paint/SVGPaintContext.h

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none 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 unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2012 Zoltan Herczeg <zherczeg@webkit.org>. 7 * Copyright (C) 2012 Zoltan Herczeg <zherczeg@webkit.org>.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (object.isSVGRoot()) { 61 if (object.isSVGRoot()) {
62 // If a transform exists, we can rely on a layer existing to apply it. 62 // If a transform exists, we can rely on a layer existing to apply it.
63 DCHECK(!objectProperties || !objectProperties->transform() || 63 DCHECK(!objectProperties || !objectProperties->transform() ||
64 object.hasLayer()); 64 object.hasLayer());
65 if (objectProperties->svgLocalToBorderBoxTransform()) { 65 if (objectProperties->svgLocalToBorderBoxTransform()) {
66 DCHECK(objectProperties->svgLocalToBorderBoxTransform()->matrix() == 66 DCHECK(objectProperties->svgLocalToBorderBoxTransform()->matrix() ==
67 transform.toTransformationMatrix()); 67 transform.toTransformationMatrix());
68 auto& paintController = context.getPaintController(); 68 auto& paintController = context.getPaintController();
69 PaintChunkProperties properties( 69 PaintChunkProperties properties(
70 paintController.currentPaintChunkProperties()); 70 paintController.currentPaintChunkProperties());
71 properties.transform = 71 properties.propertyTreeState.setTransform(
72 objectProperties->svgLocalToBorderBoxTransform(); 72 objectProperties->svgLocalToBorderBoxTransform());
73 m_transformPropertyScope.emplace(paintController, object, properties); 73 m_transformPropertyScope.emplace(paintController, object, properties);
74 } 74 }
75 } else { 75 } else {
76 DCHECK(object.isSVG()); 76 DCHECK(object.isSVG());
77 // Should only be used by LayoutSVGRoot. 77 // Should only be used by LayoutSVGRoot.
78 DCHECK(!objectProperties->svgLocalToBorderBoxTransform()); 78 DCHECK(!objectProperties->svgLocalToBorderBoxTransform());
79 79
80 if (objectProperties->transform()) { 80 if (objectProperties->transform()) {
81 DCHECK(objectProperties->transform()->matrix() == 81 DCHECK(objectProperties->transform()->matrix() ==
82 transform.toTransformationMatrix()); 82 transform.toTransformationMatrix());
83 auto& paintController = context.getPaintController(); 83 auto& paintController = context.getPaintController();
84 PaintChunkProperties properties( 84 PaintChunkProperties properties(
85 paintController.currentPaintChunkProperties()); 85 paintController.currentPaintChunkProperties());
86 properties.transform = objectProperties->transform(); 86 properties.propertyTreeState.setTransform(
87 objectProperties->transform());
87 m_transformPropertyScope.emplace(paintController, object, properties); 88 m_transformPropertyScope.emplace(paintController, object, properties);
88 } 89 }
89 } 90 }
90 } 91 }
91 } 92 }
92 93
93 private: 94 private:
94 Optional<ScopedPaintChunkProperties> m_transformPropertyScope; 95 Optional<ScopedPaintChunkProperties> m_transformPropertyScope;
95 }; 96 };
96 97
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 Optional<ClipPathClipper> m_clipPathClipper; 156 Optional<ClipPathClipper> m_clipPathClipper;
156 std::unique_ptr<SVGFilterRecordingContext> m_filterRecordingContext; 157 std::unique_ptr<SVGFilterRecordingContext> m_filterRecordingContext;
157 #if ENABLE(ASSERT) 158 #if ENABLE(ASSERT)
158 bool m_applyClipMaskAndFilterIfNecessaryCalled; 159 bool m_applyClipMaskAndFilterIfNecessaryCalled;
159 #endif 160 #endif
160 }; 161 };
161 162
162 } // namespace blink 163 } // namespace blink
163 164
164 #endif // SVGPaintContext_h 165 #endif // SVGPaintContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698