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

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

Issue 2657863004: Move scroll paint property nodes to be owned by the transform tree (Closed)
Patch Set: Rebase & remove parens 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 result = LayoutRect(rect); 115 result = LayoutRect(rect);
116 } else { 116 } else {
117 PropertyTreeState currentTreeState( 117 PropertyTreeState currentTreeState(
118 context.treeBuilderContext.current.transform, 118 context.treeBuilderContext.current.transform,
119 context.treeBuilderContext.current.clip, nullptr, nullptr); 119 context.treeBuilderContext.current.clip, nullptr);
120 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect( 120 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect(
121 FloatRect(rect), currentTreeState, *containerContentsProperties)); 121 FloatRect(rect), currentTreeState, *containerContentsProperties));
122 } 122 }
123 123
124 // Convert the result to the container's contents space. 124 // Convert the result to the container's contents space.
125 result.moveBy(-context.paintInvalidationContainer->paintOffset()); 125 result.moveBy(-context.paintInvalidationContainer->paintOffset());
126 } 126 }
127 127
128 object.adjustVisualRectForRasterEffects(result); 128 object.adjustVisualRectForRasterEffects(result);
129 129
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 public: 238 public:
239 ScopedUndoFrameViewContentClipAndScroll(const FrameView& frameView, 239 ScopedUndoFrameViewContentClipAndScroll(const FrameView& frameView,
240 PaintInvalidatorContext& context) 240 PaintInvalidatorContext& context)
241 : m_treeBuilderContext(const_cast<PaintPropertyTreeBuilderContext&>( 241 : m_treeBuilderContext(const_cast<PaintPropertyTreeBuilderContext&>(
242 context.treeBuilderContext)), 242 context.treeBuilderContext)),
243 m_savedContext(m_treeBuilderContext.current) { 243 m_savedContext(m_treeBuilderContext.current) {
244 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); 244 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled());
245 245
246 if (frameView.contentClip() == m_savedContext.clip) 246 if (frameView.contentClip() == m_savedContext.clip)
247 m_treeBuilderContext.current.clip = m_savedContext.clip->parent(); 247 m_treeBuilderContext.current.clip = m_savedContext.clip->parent();
248 if (frameView.scroll() == m_savedContext.scroll) 248 if (const auto* scrollTranslation = frameView.scrollTranslation()) {
249 m_treeBuilderContext.current.scroll = m_savedContext.scroll->parent(); 249 if (scrollTranslation->scrollNode() == m_savedContext.scroll)
250 if (frameView.scrollTranslation() == m_savedContext.transform) 250 m_treeBuilderContext.current.scroll = m_savedContext.scroll->parent();
251 m_treeBuilderContext.current.transform = 251 if (scrollTranslation == m_savedContext.transform) {
252 m_savedContext.transform->parent(); 252 m_treeBuilderContext.current.transform =
253 m_savedContext.transform->parent();
254 }
255 }
253 } 256 }
254 257
255 ~ScopedUndoFrameViewContentClipAndScroll() { 258 ~ScopedUndoFrameViewContentClipAndScroll() {
256 m_treeBuilderContext.current = m_savedContext; 259 m_treeBuilderContext.current = m_savedContext;
257 } 260 }
258 261
259 private: 262 private:
260 PaintPropertyTreeBuilderContext& m_treeBuilderContext; 263 PaintPropertyTreeBuilderContext& m_treeBuilderContext;
261 PaintPropertyTreeBuilderContext::ContainingBlockContext m_savedContext; 264 PaintPropertyTreeBuilderContext::ContainingBlockContext m_savedContext;
262 }; 265 };
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; 445 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate;
443 } 446 }
444 447
445 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 448 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
446 for (auto target : m_pendingDelayedPaintInvalidations) 449 for (auto target : m_pendingDelayedPaintInvalidations)
447 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 450 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
448 PaintInvalidationDelayedFull); 451 PaintInvalidationDelayedFull);
449 } 452 }
450 453
451 } // namespace blink 454 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698