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

Side by Side Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 2290403003: [Layout API] Remove ownerLayoutObject() from layout/PaintInvalidationState (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layout/PaintInvalidationState.h" 5 #include "core/layout/PaintInvalidationState.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
11 #include "core/layout/LayoutPart.h" 11 #include "core/layout/LayoutPart.h"
12 #include "core/layout/LayoutView.h" 12 #include "core/layout/LayoutView.h"
13 #include "core/layout/api/LayoutAPIShim.h"
13 #include "core/layout/svg/LayoutSVGRoot.h" 14 #include "core/layout/svg/LayoutSVGRoot.h"
14 #include "core/layout/svg/SVGLayoutSupport.h" 15 #include "core/layout/svg/SVGLayoutSupport.h"
15 #include "core/paint/PaintInvalidator.h" 16 #include "core/paint/PaintInvalidator.h"
16 #include "core/paint/PaintLayer.h" 17 #include "core/paint/PaintLayer.h"
17 #include "core/paint/PaintPropertyTreeBuilder.h" 18 #include "core/paint/PaintPropertyTreeBuilder.h"
18 19
19 namespace blink { 20 namespace blink {
20 21
21 static bool supportsCachedOffsets(const LayoutObject& object) 22 static bool supportsCachedOffsets(const LayoutObject& object)
22 { 23 {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 180
180 updateForCurrentObject(parentState); 181 updateForCurrentObject(parentState);
181 } 182 }
182 183
183 void PaintInvalidationState::updateForCurrentObject(const PaintInvalidationState & parentState) 184 void PaintInvalidationState::updateForCurrentObject(const PaintInvalidationState & parentState)
184 { 185 {
185 if (!m_cachedOffsetsEnabled) 186 if (!m_cachedOffsetsEnabled)
186 return; 187 return;
187 188
188 if (m_currentObject.isLayoutView()) { 189 if (m_currentObject.isLayoutView()) {
189 DCHECK(&parentState.m_currentObject == toLayoutView(m_currentObject).fra me()->ownerLayoutObject()); 190 DCHECK(&parentState.m_currentObject == LayoutAPIShim::layoutObjectFrom(t oLayoutView(m_currentObject).frame()->ownerLayoutItem()));
190 m_paintOffset += toLayoutBox(parentState.m_currentObject).contentBoxOffs et(); 191 m_paintOffset += toLayoutBox(parentState.m_currentObject).contentBoxOffs et();
191 // a LayoutView paints with a defined size but a pixel-rounded offset. 192 // a LayoutView paints with a defined size but a pixel-rounded offset.
192 m_paintOffset = LayoutSize(roundedIntSize(m_paintOffset)); 193 m_paintOffset = LayoutSize(roundedIntSize(m_paintOffset));
193 return; 194 return;
194 } 195 }
195 196
196 EPosition position = m_currentObject.styleRef().position(); 197 EPosition position = m_currentObject.styleRef().position();
197 198
198 if (position == FixedPosition) { 199 if (position == FixedPosition) {
199 if (m_paintInvalidationContainer != m_currentObject.view() && m_paintInv alidationContainer->view() == m_currentObject.view()) { 200 if (m_paintInvalidationContainer != m_currentObject.view() && m_paintInv alidationContainer->view() == m_currentObject.view()) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 540 }
540 541
541 542
542 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const 543 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const
543 { 544 {
544 DCHECK(&object == &m_paintInvalidationState.currentObject()); 545 DCHECK(&object == &m_paintInvalidationState.currentObject());
545 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); 546 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect);
546 } 547 }
547 548
548 } // namespace blink 549 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698