| 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( |
| 413 PaintInvalidationState::computePositionFromPaintInvalidationBacking() const { | 413 const LayoutPoint& visualRectLocation) const { |
| 414 #if ENABLE(ASSERT) | 414 #if ENABLE(ASSERT) |
| 415 DCHECK(!m_didUpdateForChildren); | 415 DCHECK(!m_didUpdateForChildren); |
| 416 #endif | 416 #endif |
| 417 | 417 |
| 418 // Use visual rect location for LayoutTexts because it suffices to check |
| 419 // visual rect change for layout caused invalidation. |
| 420 if (m_currentObject.isText()) |
| 421 return visualRectLocation; |
| 422 |
| 418 FloatPoint point; | 423 FloatPoint point; |
| 419 if (m_paintInvalidationContainer != &m_currentObject) { | 424 if (m_paintInvalidationContainer != &m_currentObject) { |
| 420 if (m_cachedOffsetsEnabled) { | 425 if (m_cachedOffsetsEnabled) { |
| 421 if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) | 426 if (m_currentObject.isSVG() && !m_currentObject.isSVGRoot()) |
| 422 point = m_svgTransform.mapPoint(point); | 427 point = m_svgTransform.mapPoint(point); |
| 423 point += FloatPoint(m_paintOffset); | 428 point += FloatPoint(m_paintOffset); |
| 424 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 429 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
| 425 DCHECK(point == slowLocalOriginToAncestorPoint(m_currentObject, m_pa
intInvalidationContainer, FloatPoint()); | 430 DCHECK(point == |
| 431 slowLocalOriginToAncestorPoint( |
| 432 m_currentObject, m_paintInvalidationContainer, FloatPoint())); |
| 426 #endif | 433 #endif |
| 427 } else { | 434 } else { |
| 428 point = slowLocalToAncestorPoint( | 435 point = slowLocalToAncestorPoint( |
| 429 m_currentObject, *m_paintInvalidationContainer, FloatPoint()); | 436 m_currentObject, *m_paintInvalidationContainer, FloatPoint()); |
| 430 } | 437 } |
| 431 } | 438 } |
| 432 | 439 |
| 433 if (m_paintInvalidationContainer->layer()->groupedMapping()) | 440 if (m_paintInvalidationContainer->layer()->groupedMapping()) |
| 434 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | 441 PaintLayer::mapPointInPaintInvalidationContainerToBacking( |
| 435 *m_paintInvalidationContainer, point); | 442 *m_paintInvalidationContainer, point); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } | 627 } |
| 621 | 628 |
| 622 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( | 629 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( |
| 623 const LayoutObject& object, | 630 const LayoutObject& object, |
| 624 LayoutRect& rect) const { | 631 LayoutRect& rect) const { |
| 625 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 632 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
| 626 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 633 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
| 627 } | 634 } |
| 628 | 635 |
| 629 } // namespace blink | 636 } // namespace blink |
| OLD | NEW |