Chromium Code Reviews| 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/PaintInvalidator.h" | 5 #include "core/paint/PaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/editing/FrameSelection.h" | 7 #include "core/editing/FrameSelection.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 const LayoutBoxModelObject& ancestor, | 26 const LayoutBoxModelObject& ancestor, |
| 27 const Rect& rect) { | 27 const Rect& rect) { |
| 28 if (object.isSVGChild()) { | 28 if (object.isSVGChild()) { |
| 29 LayoutRect result; | 29 LayoutRect result; |
| 30 SVGLayoutSupport::mapToVisualRectInAncestorSpace(object, &ancestor, | 30 SVGLayoutSupport::mapToVisualRectInAncestorSpace(object, &ancestor, |
| 31 FloatRect(rect), result); | 31 FloatRect(rect), result); |
| 32 return result; | 32 return result; |
| 33 } | 33 } |
| 34 | 34 |
| 35 LayoutRect result(rect); | 35 LayoutRect result(rect); |
| 36 if (object.isLayoutView()) | 36 if (object.isLayoutView()) { |
| 37 toLayoutView(object).mapToVisualRectInAncestorSpace( | 37 TransformState transformState(TransformState::ApplyTransformDirection, |
| 38 &ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags); | 38 FloatQuad(FloatRect(rect))); |
| 39 else | 39 toLayoutView(object).mapToVisualRectInAncestorSpaceInternal( |
| 40 object.mapToVisualRectInAncestorSpace(&ancestor, result); | 40 &ancestor, transformState, InputIsInFrameCoordinates, |
| 41 DefaultVisualRectFlags); | |
| 42 transformState.flatten(); | |
| 43 return LayoutRect(transformState.lastPlanarQuad().boundingBox()); | |
|
Xianzhu
2017/03/03 01:24:42
Can you wrap the above code into LayoutView::mapTo
chrishtr
2017/03/03 02:45:11
Done.
| |
| 44 } | |
| 45 | |
| 46 object.mapToVisualRectInAncestorSpace(&ancestor, result); | |
| 41 return result; | 47 return result; |
| 42 } | 48 } |
| 43 | 49 |
| 44 // TODO(wangxianzhu): Combine this into | 50 // TODO(wangxianzhu): Combine this into |
| 45 // PaintInvalidator::mapLocalRectToBacking() when removing | 51 // PaintInvalidator::mapLocalRectToBacking() when removing |
| 46 // PaintInvalidationState. | 52 // PaintInvalidationState. |
| 47 // This function is templatized to avoid FloatRect<->LayoutRect conversions | 53 // This function is templatized to avoid FloatRect<->LayoutRect conversions |
| 48 // which affect performance. | 54 // which affect performance. |
| 49 template <typename Rect, typename Point> | 55 template <typename Rect, typename Point> |
| 50 static LayoutRect mapLocalRectToPaintInvalidationBacking( | 56 static LayoutRect mapLocalRectToPaintInvalidationBacking( |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; | 473 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; |
| 468 } | 474 } |
| 469 | 475 |
| 470 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 476 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 471 for (auto target : m_pendingDelayedPaintInvalidations) | 477 for (auto target : m_pendingDelayedPaintInvalidations) |
| 472 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 478 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 473 PaintInvalidationDelayedFull); | 479 PaintInvalidationDelayedFull); |
| 474 } | 480 } |
| 475 | 481 |
| 476 } // namespace blink | 482 } // namespace blink |
| OLD | NEW |