OLD | NEW |
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/BoxPaintInvalidator.h" | 5 #include "core/paint/BoxPaintInvalidator.h" |
6 | 6 |
7 #include "core/frame/Settings.h" | 7 #include "core/frame/Settings.h" |
8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
9 #include "core/layout/compositing/CompositedLayerMapping.h" | 9 #include "core/layout/compositing/CompositedLayerMapping.h" |
10 #include "core/paint/ObjectPaintInvalidator.h" | 10 #include "core/paint/ObjectPaintInvalidator.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 reason == PaintInvalidationIncremental ? m_box.borderRight() | 78 reason == PaintInvalidationIncremental ? m_box.borderRight() |
79 : LayoutUnit()); | 79 : LayoutUnit()); |
80 LayoutRect bottomDelta = computeBottomDelta( | 80 LayoutRect bottomDelta = computeBottomDelta( |
81 newRect.location(), oldRect.size(), newRect.size(), | 81 newRect.location(), oldRect.size(), newRect.size(), |
82 reason == PaintInvalidationIncremental ? m_box.borderBottom() | 82 reason == PaintInvalidationIncremental ? m_box.borderBottom() |
83 : LayoutUnit()); | 83 : LayoutUnit()); |
84 | 84 |
85 if (rightDelta.isEmpty() && bottomDelta.isEmpty()) | 85 if (rightDelta.isEmpty() && bottomDelta.isEmpty()) |
86 return false; | 86 return false; |
87 | 87 |
88 ObjectPaintInvalidator objectPaintInvalidator(m_box); | 88 ObjectPaintInvalidatorWithContext objectPaintInvalidator(m_box, m_context); |
89 objectPaintInvalidator.invalidatePaintUsingContainer( | 89 objectPaintInvalidator.invalidatePaintRectangleWithContext(rightDelta, |
90 *m_context.paintInvalidationContainer, rightDelta, reason); | 90 reason); |
91 objectPaintInvalidator.invalidatePaintUsingContainer( | 91 objectPaintInvalidator.invalidatePaintRectangleWithContext(bottomDelta, |
92 *m_context.paintInvalidationContainer, bottomDelta, reason); | 92 reason); |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 PaintInvalidationReason BoxPaintInvalidator::computePaintInvalidationReason() { | 96 PaintInvalidationReason BoxPaintInvalidator::computePaintInvalidationReason() { |
97 PaintInvalidationReason reason = | 97 PaintInvalidationReason reason = |
98 ObjectPaintInvalidatorWithContext(m_box, m_context) | 98 ObjectPaintInvalidatorWithContext(m_box, m_context) |
99 .computePaintInvalidationReason(); | 99 .computePaintInvalidationReason(); |
100 | 100 |
101 if (reason != PaintInvalidationIncremental) | 101 if (reason != PaintInvalidationIncremental) |
102 return reason; | 102 return reason; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 LayoutRect BoxPaintInvalidator::previousLayoutOverflowRect() { | 365 LayoutRect BoxPaintInvalidator::previousLayoutOverflowRect() { |
366 DCHECK(m_box.hasPreviousBoxGeometries() == | 366 DCHECK(m_box.hasPreviousBoxGeometries() == |
367 previousBoxGeometriesMap().contains(&m_box)); | 367 previousBoxGeometriesMap().contains(&m_box)); |
368 return m_box.hasPreviousBoxGeometries() | 368 return m_box.hasPreviousBoxGeometries() |
369 ? previousBoxGeometriesMap().get(&m_box).layoutOverflowRect | 369 ? previousBoxGeometriesMap().get(&m_box).layoutOverflowRect |
370 : LayoutRect(LayoutPoint(), m_box.previousSize()); | 370 : LayoutRect(LayoutPoint(), m_box.previousSize()); |
371 } | 371 } |
372 | 372 |
373 } // namespace blink | 373 } // namespace blink |
OLD | NEW |