Chromium Code Reviews| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 if (m_paintInvalidationContainer->layer()->groupedMapping()) | 407 if (m_paintInvalidationContainer->layer()->groupedMapping()) |
| 408 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect); | 408 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect); |
| 409 return rect; | 409 return rect; |
| 410 } | 410 } |
| 411 | 411 |
| 412 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) | 412 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) |
| 413 { | 413 { |
| 414 // TODO(wkorman): The flip below is required because visual rects are | 414 // TODO(wkorman): The flip below is required because visual rects are |
| 415 // currently in "physical coordinates with flipped block-flow direction" | 415 // currently in "physical coordinates with flipped block-flow direction" |
| 416 // (see LayoutBoxModelObject.h) but we need them to be in physical | 416 // (see LayoutBoxModelObject.h) but we need them to be in physical |
| 417 // coordinates. | 417 // coordinates. When we're mapping within exactly one object we keep the |
| 418 if (object.isBox()) | 418 // input rect flipped because we'd just have to re-flip in short order to |
| 419 // produce the final result. | |
|
chrishtr
2016/09/07 22:47:23
"because the output of this method must be in the
wkorman
2016/09/07 22:52:28
Conceptually yes (and I think we'd need an isBox()
chrishtr
2016/09/07 22:54:02
Right ok. Makes sense, these are indeed important.
wkorman
2016/09/07 23:18:18
Updated comment.
| |
| 420 if (object.isBox() && object != ancestor) | |
| 419 toLayoutBox(&object)->flipForWritingMode(rect); | 421 toLayoutBox(&object)->flipForWritingMode(rect); |
| 420 | 422 |
| 421 if (object.isLayoutView()) | 423 if (object.isLayoutView()) |
| 422 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags); | 424 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags); |
| 423 else | 425 else |
| 424 object.mapToVisualRectInAncestorSpace(&ancestor, rect); | 426 object.mapToVisualRectInAncestorSpace(&ancestor, rect); |
| 425 } | 427 } |
| 426 | 428 |
| 427 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const | 429 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const |
| 428 { | 430 { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 } | 542 } |
| 541 | 543 |
| 542 | 544 |
| 543 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const | 545 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const |
| 544 { | 546 { |
| 545 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 547 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
| 546 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); | 548 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); |
| 547 } | 549 } |
| 548 | 550 |
| 549 } // namespace blink | 551 } // namespace blink |
| OLD | NEW |