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

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

Issue 2625133003: Handle geometry effects of filters in GeometryMapper (Closed)
Patch Set: Rebaseline tests 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 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // snapping. 104 // snapping.
105 rect = Rect(enclosingIntRect(rect)); 105 rect = Rect(enclosingIntRect(rect));
106 } 106 }
107 107
108 const auto* containerContentsProperties = 108 const auto* containerContentsProperties =
109 context.paintInvalidationContainer->paintProperties() 109 context.paintInvalidationContainer->paintProperties()
110 ->contentsProperties(); 110 ->contentsProperties();
111 if (context.treeBuilderContext.current.transform == 111 if (context.treeBuilderContext.current.transform ==
112 containerContentsProperties->transform() && 112 containerContentsProperties->transform() &&
113 context.treeBuilderContext.current.clip == 113 context.treeBuilderContext.current.clip ==
114 containerContentsProperties->clip()) { 114 containerContentsProperties->clip() &&
115 context.treeBuilderContext.currentEffect ==
116 containerContentsProperties->effect()) {
115 result = LayoutRect(rect); 117 result = LayoutRect(rect);
116 } else { 118 } else {
117 PropertyTreeState currentTreeState( 119 PropertyTreeState currentTreeState(
118 context.treeBuilderContext.current.transform, 120 context.treeBuilderContext.current.transform,
119 context.treeBuilderContext.current.clip, nullptr, nullptr); 121 context.treeBuilderContext.current.clip,
122 context.treeBuilderContext.currentEffect, nullptr);
120 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect( 123 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect(
121 FloatRect(rect), currentTreeState, *containerContentsProperties)); 124 FloatRect(rect), currentTreeState, *containerContentsProperties));
122 } 125 }
123 126
124 // Convert the result to the container's contents space. 127 // Convert the result to the container's contents space.
125 result.moveBy(-context.paintInvalidationContainer->paintOffset()); 128 result.moveBy(-context.paintInvalidationContainer->paintOffset());
126 } 129 }
127 130
128 object.adjustVisualRectForRasterEffects(result); 131 object.adjustVisualRectForRasterEffects(result);
129 132
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 326 }
324 327
325 DCHECK(context.paintInvalidationContainer == 328 DCHECK(context.paintInvalidationContainer ==
326 object.containerForPaintInvalidation()); 329 object.containerForPaintInvalidation());
327 DCHECK(context.paintingLayer == object.paintingLayer()); 330 DCHECK(context.paintingLayer == object.paintingLayer());
328 331
329 if (object.mayNeedPaintInvalidationSubtree()) 332 if (object.mayNeedPaintInvalidationSubtree())
330 context.forcedSubtreeInvalidationFlags |= 333 context.forcedSubtreeInvalidationFlags |=
331 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking; 334 PaintInvalidatorContext::ForcedSubtreeInvalidationChecking;
332 335
333 // TODO(crbug.com/637313): This is temporary before we support filters in
334 // GeometryMapper.
335 // TODO(crbug.com/648274): This is a workaround for multi-column contents. 336 // TODO(crbug.com/648274): This is a workaround for multi-column contents.
336 if (object.hasFilterInducingProperty() || object.isLayoutFlowThread()) { 337 if (object.isLayoutFlowThread()) {
337 context.forcedSubtreeInvalidationFlags |= 338 context.forcedSubtreeInvalidationFlags |=
338 PaintInvalidatorContext::ForcedSubtreeSlowPathRect; 339 PaintInvalidatorContext::ForcedSubtreeSlowPathRect;
339 } 340 }
340 341
341 ObjectPaintInvalidator objectPaintInvalidator(object); 342 ObjectPaintInvalidator objectPaintInvalidator(object);
342 context.oldVisualRect = object.previousVisualRect(); 343 context.oldVisualRect = object.previousVisualRect();
343 context.oldLocation = objectPaintInvalidator.previousLocationInBacking(); 344 context.oldLocation = objectPaintInvalidator.previousLocationInBacking();
344 context.newVisualRect = computeVisualRectInBacking(object, context); 345 context.newVisualRect = computeVisualRectInBacking(object, context);
345 context.newLocation = computeLocationInBacking(object, context); 346 context.newLocation = computeLocationInBacking(object, context);
346 347
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; 444 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate;
444 } 445 }
445 446
446 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 447 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
447 for (auto target : m_pendingDelayedPaintInvalidations) 448 for (auto target : m_pendingDelayedPaintInvalidations)
448 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 449 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
449 PaintInvalidationDelayedFull); 450 PaintInvalidationDelayedFull);
450 } 451 }
451 452
452 } // namespace blink 453 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698