OLD | NEW |
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" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (!m_cachedOffsetsEnabled) | 341 if (!m_cachedOffsetsEnabled) |
342 return; | 342 return; |
343 | 343 |
344 if (!m_currentObject.isBox()) | 344 if (!m_currentObject.isBox()) |
345 return; | 345 return; |
346 const LayoutBox& box = toLayoutBox(m_currentObject); | 346 const LayoutBox& box = toLayoutBox(m_currentObject); |
347 | 347 |
348 if (box.isLayoutView()) { | 348 if (box.isLayoutView()) { |
349 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 349 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
350 if (box != m_paintInvalidationContainer) { | 350 if (box != m_paintInvalidationContainer) { |
351 m_paintOffset -= toLayoutView(box).frameView()->scrollOffset(); | 351 m_paintOffset -= |
| 352 LayoutSize(toLayoutView(box).frameView()->scrollOffset()); |
352 addClipRectRelativeToPaintOffset(toLayoutView(box).viewRect()); | 353 addClipRectRelativeToPaintOffset(toLayoutView(box).viewRect()); |
353 } | 354 } |
354 return; | 355 return; |
355 } | 356 } |
356 } else if (box.isSVGRoot()) { | 357 } else if (box.isSVGRoot()) { |
357 const LayoutSVGRoot& svgRoot = toLayoutSVGRoot(box); | 358 const LayoutSVGRoot& svgRoot = toLayoutSVGRoot(box); |
358 if (svgRoot.shouldApplyViewportClip()) | 359 if (svgRoot.shouldApplyViewportClip()) |
359 addClipRectRelativeToPaintOffset( | 360 addClipRectRelativeToPaintOffset( |
360 LayoutRect(LayoutPoint(), LayoutSize(svgRoot.pixelSnappedSize()))); | 361 LayoutRect(LayoutPoint(), LayoutSize(svgRoot.pixelSnappedSize()))); |
361 } else if (box.isTableRow()) { | 362 } else if (box.isTableRow()) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 611 } |
611 | 612 |
612 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( | 613 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( |
613 const LayoutObject& object, | 614 const LayoutObject& object, |
614 LayoutRect& rect) const { | 615 LayoutRect& rect) const { |
615 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 616 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
616 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 617 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
617 } | 618 } |
618 | 619 |
619 } // namespace blink | 620 } // namespace blink |
OLD | NEW |