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 toLayoutView(object).mapToVisualRectInAncestorSpace( |
38 &ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags); | 38 &ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags); |
39 else | 39 } |
40 object.mapToVisualRectInAncestorSpace(&ancestor, result); | 40 |
| 41 object.mapToVisualRectInAncestorSpace(&ancestor, result); |
41 return result; | 42 return result; |
42 } | 43 } |
43 | 44 |
44 // TODO(wangxianzhu): Combine this into | 45 // TODO(wangxianzhu): Combine this into |
45 // PaintInvalidator::mapLocalRectToBacking() when removing | 46 // PaintInvalidator::mapLocalRectToBacking() when removing |
46 // PaintInvalidationState. | 47 // PaintInvalidationState. |
47 // This function is templatized to avoid FloatRect<->LayoutRect conversions | 48 // This function is templatized to avoid FloatRect<->LayoutRect conversions |
48 // which affect performance. | 49 // which affect performance. |
49 template <typename Rect, typename Point> | 50 template <typename Rect, typename Point> |
50 static LayoutRect mapLocalRectToPaintInvalidationBacking( | 51 static LayoutRect mapLocalRectToPaintInvalidationBacking( |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 468 } |
468 } | 469 } |
469 | 470 |
470 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 471 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
471 for (auto target : m_pendingDelayedPaintInvalidations) | 472 for (auto target : m_pendingDelayedPaintInvalidations) |
472 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 473 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
473 PaintInvalidationDelayedFull); | 474 PaintInvalidationDelayedFull); |
474 } | 475 } |
475 | 476 |
476 } // namespace blink | 477 } // namespace blink |
OLD | NEW |