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

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

Issue 2343673003: SVG root viewport clip in paint property tree (Closed)
Patch Set: - Created 4 years, 3 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"
11 #include "core/layout/LayoutBlockFlow.h" 11 #include "core/layout/LayoutBlockFlow.h"
12 #include "core/layout/LayoutObject.h" 12 #include "core/layout/LayoutObject.h"
13 #include "core/layout/LayoutTable.h" 13 #include "core/layout/LayoutTable.h"
14 #include "core/layout/LayoutView.h" 14 #include "core/layout/LayoutView.h"
15 #include "core/layout/svg/SVGLayoutSupport.h" 15 #include "core/layout/svg/SVGLayoutSupport.h"
16 #include "core/paint/ObjectPaintProperties.h" 16 #include "core/paint/ObjectPaintProperties.h"
17 #include "core/paint/PaintLayer.h" 17 #include "core/paint/PaintLayer.h"
18 #include "core/paint/PaintLayerScrollableArea.h" 18 #include "core/paint/PaintLayerScrollableArea.h"
19 #include "core/paint/PaintPropertyTreeBuilder.h" 19 #include "core/paint/PaintPropertyTreeBuilder.h"
20 20
21 namespace blink { 21 namespace blink {
22 22
23 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) 23 static LayoutRect slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, const FloatRect& rect)
24 { 24 {
25 if (object.isSVG() && !object.isSVGRoot()) {
26 LayoutRect result;
27 SVGLayoutSupport::mapToVisualRectInAncestorSpace(object, &ancestor, rect , result);
pdr. 2016/09/14 22:42:39 If we override this in all SVG subclasses, will th
Xianzhu 2016/09/14 23:35:31 We didn't override mapToVisualRectInAncestorSpace
28 return result;
29 }
30
31 LayoutRect result(rect);
25 if (object.isLayoutView()) 32 if (object.isLayoutView())
26 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags); 33 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, result, I nputIsInFrameCoordinates, DefaultVisualRectFlags);
27 else 34 else
28 object.mapToVisualRectInAncestorSpace(&ancestor, rect); 35 object.mapToVisualRectInAncestorSpace(&ancestor, result);
36 return result;
29 } 37 }
30 38
31 // TODO(wangxianzhu): Combine this into PaintInvalidator::mapLocalRectToPaintInv alidationBacking() when removing PaintInvalidationState. 39 // TODO(wangxianzhu): Combine this into PaintInvalidator::mapLocalRectToPaintInv alidationBacking() when removing PaintInvalidationState.
32 static LayoutRect mapLocalRectToPaintInvalidationBacking(GeometryMapper& geometr yMapper, const LayoutObject& object, const FloatRect& localRect, const PaintInva lidatorContext& context) 40 static LayoutRect mapLocalRectToPaintInvalidationBacking(GeometryMapper& geometr yMapper, const LayoutObject& object, const FloatRect& localRect, const PaintInva lidatorContext& context)
33 { 41 {
34 // TODO(wkorman): The flip below is required because visual rects are 42 // TODO(wkorman): The flip below is required because visual rects are
35 // currently in "physical coordinates with flipped block-flow direction" 43 // currently in "physical coordinates with flipped block-flow direction"
36 // (see LayoutBoxModelObject.h) but we need them to be in physical 44 // (see LayoutBoxModelObject.h) but we need them to be in physical
37 // coordinates. 45 // coordinates.
38 FloatRect rect = localRect; 46 FloatRect rect = localRect;
39 if (object.isBox()) 47 if (object.isBox())
40 toLayoutBox(object).flipForWritingMode(rect); 48 toLayoutBox(object).flipForWritingMode(rect);
41 49
42 LayoutRect result; 50 LayoutRect result;
43 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced SubtreeSlowPathRect) { 51 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced SubtreeSlowPathRect) {
44 result = LayoutRect(rect); 52 result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvali dationContainer, rect);
45 slowMapToVisualRectInAncestorSpace(object, *context.paintInvalidationCon tainer, result);
46 } else if (object == context.paintInvalidationContainer) { 53 } else if (object == context.paintInvalidationContainer) {
47 result = LayoutRect(rect); 54 result = LayoutRect(rect);
48 } else { 55 } else {
49 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur rentEffect); 56 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur rentEffect);
50 PropertyTreeState containerTreeState; 57 PropertyTreeState containerTreeState;
51 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties(); 58 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties();
52 containerPaintProperties->getContentsProperties(containerTreeState); 59 containerPaintProperties->getContentsProperties(containerTreeState);
53 60
54 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); 61 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
55 bool success = false; 62 bool success = false;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 object.getMutableForPainting().clearPaintInvalidationFlags(); 285 object.getMutableForPainting().clearPaintInvalidationFlags();
279 } 286 }
280 287
281 void PaintInvalidator::processPendingDelayedPaintInvalidations() 288 void PaintInvalidator::processPendingDelayedPaintInvalidations()
282 { 289 {
283 for (auto target : m_pendingDelayedPaintInvalidations) 290 for (auto target : m_pendingDelayedPaintInvalidations)
284 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull); 291 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull);
285 } 292 }
286 293
287 } // namespace blink 294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698