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

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

Issue 2338373004: Refactor PropertyTreeState as GeometryPropertyTreeState (Closed)
Patch Set: Rebase 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"
(...skipping 28 matching lines...) Expand all
39 if (object.isBox()) 39 if (object.isBox())
40 toLayoutBox(object).flipForWritingMode(rect); 40 toLayoutBox(object).flipForWritingMode(rect);
41 41
42 LayoutRect result; 42 LayoutRect result;
43 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced SubtreeSlowPathRect) { 43 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced SubtreeSlowPathRect) {
44 result = LayoutRect(rect); 44 result = LayoutRect(rect);
45 slowMapToVisualRectInAncestorSpace(object, *context.paintInvalidationCon tainer, result); 45 slowMapToVisualRectInAncestorSpace(object, *context.paintInvalidationCon tainer, result);
46 } else if (object == context.paintInvalidationContainer) { 46 } else if (object == context.paintInvalidationContainer) {
47 result = LayoutRect(rect); 47 result = LayoutRect(rect);
48 } else { 48 } else {
49 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur rentEffect); 49 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon text.currentEffect);
50 PropertyTreeState containerTreeState; 50 GeometryPropertyTreeState containerTreeState;
51 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties(); 51 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties();
52 containerPaintProperties->getContentsProperties(containerTreeState); 52 containerPaintProperties->getContentsProperties(containerTreeState);
53 53
54 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); 54 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
55 bool success = false; 55 bool success = false;
56 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec t, currentTreeState, containerTreeState, success)); 56 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec t, currentTreeState, containerTreeState, success));
57 DCHECK(success); 57 DCHECK(success);
58 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai ntOffset); 58 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai ntOffset);
59 } 59 }
60 60
(...skipping 24 matching lines...) Expand all
85 return mapLocalRectToPaintInvalidationBacking(object, localRect, context); 85 return mapLocalRectToPaintInvalidationBacking(object, localRect, context);
86 } 86 }
87 87
88 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const LayoutObject& object, const PaintInvalidatorContext& context) 88 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const LayoutObject& object, const PaintInvalidatorContext& context)
89 { 89 {
90 FloatPoint point; 90 FloatPoint point;
91 if (object != context.paintInvalidationContainer) { 91 if (object != context.paintInvalidationContainer) {
92 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)) ; 92 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)) ;
93 93
94 bool success = false; 94 bool success = false;
95 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur rentEffect); 95 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon text.currentEffect);
96 PropertyTreeState containerTreeState; 96 GeometryPropertyTreeState containerTreeState;
97 context.paintInvalidationContainer->objectPaintProperties()->getContents Properties(containerTreeState); 97 context.paintInvalidationContainer->objectPaintProperties()->getContents Properties(containerTreeState);
98 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa tSize()), currentTreeState, containerTreeState, success).location(); 98 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa tSize()), currentTreeState, containerTreeState, success).location();
99 DCHECK(success); 99 DCHECK(success);
100 } 100 }
101 101
102 if (context.paintInvalidationContainer->layer()->groupedMapping()) 102 if (context.paintInvalidationContainer->layer()->groupedMapping())
103 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint InvalidationContainer, point); 103 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint InvalidationContainer, point);
104 104
105 return LayoutPoint(point); 105 return LayoutPoint(point);
106 } 106 }
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 object.getMutableForPainting().clearPaintInvalidationFlags(); 278 object.getMutableForPainting().clearPaintInvalidationFlags();
279 } 279 }
280 280
281 void PaintInvalidator::processPendingDelayedPaintInvalidations() 281 void PaintInvalidator::processPendingDelayedPaintInvalidations()
282 { 282 {
283 for (auto target : m_pendingDelayedPaintInvalidations) 283 for (auto target : m_pendingDelayedPaintInvalidations)
284 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull); 284 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull);
285 } 285 }
286 286
287 } // namespace blink 287 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698