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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 const LayoutObject& object, | 492 const LayoutObject& object, |
493 const LayoutBoxModelObject& ancestor, | 493 const LayoutBoxModelObject& ancestor, |
494 LayoutRect& rect) { | 494 LayoutRect& rect) { |
495 // TODO(wkorman): The flip below is required because visual rects are | 495 // TODO(wkorman): The flip below is required because visual rects are |
496 // currently in "physical coordinates with flipped block-flow direction" | 496 // currently in "physical coordinates with flipped block-flow direction" |
497 // (see LayoutBoxModelObject.h) but we need them to be in physical | 497 // (see LayoutBoxModelObject.h) but we need them to be in physical |
498 // coordinates. | 498 // coordinates. |
499 if (object.isBox()) | 499 if (object.isBox()) |
500 toLayoutBox(&object)->flipForWritingMode(rect); | 500 toLayoutBox(&object)->flipForWritingMode(rect); |
501 | 501 |
502 if (object.isLayoutView()) | 502 if (object.isLayoutView()) { |
503 toLayoutView(object).mapToVisualRectInAncestorSpace( | 503 TransformState transformState(TransformState::ApplyTransformDirection, |
504 &ancestor, rect, InputIsInFrameCoordinates, DefaultVisualRectFlags); | 504 FloatQuad(FloatRect(rect))); |
505 else | 505 toLayoutView(object).mapToVisualRectInAncestorSpaceInternal( |
| 506 &ancestor, transformState, InputIsInFrameCoordinates, |
| 507 DefaultVisualRectFlags); |
| 508 transformState.flatten(); |
| 509 rect = LayoutRect(transformState.lastPlanarQuad().boundingBox()); |
| 510 } else { |
506 object.mapToVisualRectInAncestorSpace(&ancestor, rect); | 511 object.mapToVisualRectInAncestorSpace(&ancestor, rect); |
| 512 } |
507 } | 513 } |
508 | 514 |
509 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer( | 515 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer( |
510 LayoutRect& rect) const { | 516 LayoutRect& rect) const { |
511 #if DCHECK_IS_ON() | 517 #if DCHECK_IS_ON() |
512 DCHECK(!m_didUpdateForChildren); | 518 DCHECK(!m_didUpdateForChildren); |
513 #endif | 519 #endif |
514 | 520 |
515 if (m_cachedOffsetsEnabled) { | 521 if (m_cachedOffsetsEnabled) { |
516 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 522 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 } | 635 } |
630 | 636 |
631 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( | 637 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( |
632 const LayoutObject& object, | 638 const LayoutObject& object, |
633 LayoutRect& rect) const { | 639 LayoutRect& rect) const { |
634 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 640 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
635 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 641 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
636 } | 642 } |
637 | 643 |
638 } // namespace blink | 644 } // namespace blink |
OLD | NEW |