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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2623823002: Rename and change parameter type of some GeometryMapper methods (Closed)
Patch Set: Swap local and ancestor parameters in ancestorToLocalRect(). Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintInvalidator.h" 5 #include "core/paint/PaintInvalidator.h"
6 6
7 #include "core/editing/FrameSelection.h" 7 #include "core/editing/FrameSelection.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 context.treeBuilderContext.current.transform, 103 context.treeBuilderContext.current.transform,
104 context.treeBuilderContext.current.clip, 104 context.treeBuilderContext.current.clip,
105 context.treeBuilderContext.currentEffect, 105 context.treeBuilderContext.currentEffect,
106 context.treeBuilderContext.current.scroll); 106 context.treeBuilderContext.current.scroll);
107 const auto* containerPaintProperties = 107 const auto* containerPaintProperties =
108 context.paintInvalidationContainer->paintProperties(); 108 context.paintInvalidationContainer->paintProperties();
109 auto containerContentsProperties = 109 auto containerContentsProperties =
110 containerPaintProperties->contentsProperties(); 110 containerPaintProperties->contentsProperties();
111 111
112 bool success = false; 112 bool success = false;
113 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace( 113 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect(
114 rect, currentTreeState, containerContentsProperties, success)); 114 rect, currentTreeState, containerContentsProperties, success));
115 DCHECK(success); 115 DCHECK(success);
116 116
117 // Convert the result to the container's contents space. 117 // Convert the result to the container's contents space.
118 result.moveBy(-context.paintInvalidationContainer->paintOffset()); 118 result.moveBy(-context.paintInvalidationContainer->paintOffset());
119 } 119 }
120 120
121 object.adjustVisualRectForRasterEffects(result); 121 object.adjustVisualRectForRasterEffects(result);
122 122
123 PaintLayer::mapRectInPaintInvalidationContainerToBacking( 123 PaintLayer::mapRectInPaintInvalidationContainerToBacking(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const PaintInvalidatorContext& context) { 159 const PaintInvalidatorContext& context) {
160 // Use visual rect location for LayoutTexts because it suffices to check 160 // Use visual rect location for LayoutTexts because it suffices to check
161 // visual rect change for layout caused invalidation. 161 // visual rect change for layout caused invalidation.
162 if (object.isText()) 162 if (object.isText())
163 return context.newVisualRect.location(); 163 return context.newVisualRect.location();
164 164
165 FloatPoint point; 165 FloatPoint point;
166 if (object != context.paintInvalidationContainer) { 166 if (object != context.paintInvalidationContainer) {
167 point.moveBy(FloatPoint(object.paintOffset())); 167 point.moveBy(FloatPoint(object.paintOffset()));
168 168
169 PropertyTreeState currentTreeState(
170 context.treeBuilderContext.current.transform,
171 context.treeBuilderContext.current.clip,
172 context.treeBuilderContext.currentEffect,
173 context.treeBuilderContext.current.scroll);
174 const auto* containerPaintProperties = 169 const auto* containerPaintProperties =
175 context.paintInvalidationContainer->paintProperties(); 170 context.paintInvalidationContainer->paintProperties();
176 auto containerContentsProperties = 171 auto containerContentsProperties =
177 containerPaintProperties->contentsProperties(); 172 containerPaintProperties->contentsProperties();
178 173
179 bool success = false; 174 bool success = false;
180 point = m_geometryMapper 175 point = m_geometryMapper
181 .mapRectToDestinationSpace(FloatRect(point, FloatSize()), 176 .sourceToDestinationRect(
182 currentTreeState, 177 FloatRect(point, FloatSize()),
183 containerContentsProperties, success) 178 context.treeBuilderContext.current.transform,
179 containerContentsProperties.transform(), success)
184 .location(); 180 .location();
185 DCHECK(success); 181 DCHECK(success);
186 182
187 // Convert the result to the container's contents space. 183 // Convert the result to the container's contents space.
188 point.moveBy(-context.paintInvalidationContainer->paintOffset()); 184 point.moveBy(-context.paintInvalidationContainer->paintOffset());
189 } 185 }
190 186
191 PaintLayer::mapPointInPaintInvalidationContainerToBacking( 187 PaintLayer::mapPointInPaintInvalidationContainerToBacking(
192 *context.paintInvalidationContainer, point); 188 *context.paintInvalidationContainer, point);
193 189
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; 446 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate;
451 } 447 }
452 448
453 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 449 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
454 for (auto target : m_pendingDelayedPaintInvalidations) 450 for (auto target : m_pendingDelayedPaintInvalidations)
455 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 451 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
456 PaintInvalidationDelayedFull); 452 PaintInvalidationDelayedFull);
457 } 453 }
458 454
459 } // namespace blink 455 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698