| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 object.localToAncestorPoint(point, &ancestor, TraverseDocumentBoundaries); | 402 object.localToAncestorPoint(point, &ancestor, TraverseDocumentBoundaries); |
| 403 // Paint invalidation does not include scroll of the ancestor. | 403 // Paint invalidation does not include scroll of the ancestor. |
| 404 if (ancestor.isBox()) { | 404 if (ancestor.isBox()) { |
| 405 const LayoutBox* box = toLayoutBox(&ancestor); | 405 const LayoutBox* box = toLayoutBox(&ancestor); |
| 406 if (box->hasOverflowClip()) | 406 if (box->hasOverflowClip()) |
| 407 result.move(box->scrolledContentOffset()); | 407 result.move(box->scrolledContentOffset()); |
| 408 } | 408 } |
| 409 return result; | 409 return result; |
| 410 } | 410 } |
| 411 | 411 |
| 412 LayoutPoint | 412 LayoutPoint PaintInvalidationState::computeLocationInBacking() const { |
| 413 PaintInvalidationState::computePositionFromPaintInvalidationBacking() const { | |
| 414 #if ENABLE(ASSERT) | 413 #if ENABLE(ASSERT) |
| 415 DCHECK(!m_didUpdateForChildren); | 414 DCHECK(!m_didUpdateForChildren); |
| 416 #endif | 415 #endif |
| 417 | 416 |
| 418 FloatPoint point; | 417 FloatPoint point; |
| 419 if (m_paintInvalidationContainer != &m_currentObject) { | 418 if (m_paintInvalidationContainer != &m_currentObject) { |
| 420 if (m_cachedOffsetsEnabled) { | 419 if (m_cachedOffsetsEnabled) { |
| 421 if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) | 420 if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) |
| 422 point = m_svgTransform.mapPoint(point); | 421 point = m_svgTransform.mapPoint(point); |
| 423 point += FloatPoint(m_paintOffset); | 422 point += FloatPoint(m_paintOffset); |
| 424 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 423 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
| 425 DCHECK(point == slowLocalOriginToAncestorPoint(m_currentObject, m_pa
intInvalidationContainer, FloatPoint()); | 424 DCHECK(point == |
| 425 slowLocalOriginToAncestorPoint( |
| 426 m_currentObject, m_paintInvalidationContainer, FloatPoint())); |
| 426 #endif | 427 #endif |
| 427 } else { | 428 } else { |
| 428 point = slowLocalToAncestorPoint( | 429 point = slowLocalToAncestorPoint( |
| 429 m_currentObject, *m_paintInvalidationContainer, FloatPoint()); | 430 m_currentObject, *m_paintInvalidationContainer, FloatPoint()); |
| 430 } | 431 } |
| 431 } | 432 } |
| 432 | 433 |
| 433 if (m_paintInvalidationContainer->layer()->groupedMapping()) | 434 if (m_paintInvalidationContainer->layer()->groupedMapping()) |
| 434 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | 435 PaintLayer::mapPointInPaintInvalidationContainerToBacking( |
| 435 *m_paintInvalidationContainer, point); | 436 *m_paintInvalidationContainer, point); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } | 621 } |
| 621 | 622 |
| 622 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( | 623 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( |
| 623 const LayoutObject& object, | 624 const LayoutObject& object, |
| 624 LayoutRect& rect) const { | 625 LayoutRect& rect) const { |
| 625 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 626 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
| 626 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 627 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
| 627 } | 628 } |
| 628 | 629 |
| 629 } // namespace blink | 630 } // namespace blink |
| OLD | NEW |