| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 NOTREACHED(); | 628 NOTREACHED(); |
| 629 } | 629 } |
| 630 | 630 |
| 631 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY | 631 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY |
| 632 | 632 |
| 633 static const PaintPropertyTreeBuilderContext& dummyTreeBuilderContext() { | 633 static const PaintPropertyTreeBuilderContext& dummyTreeBuilderContext() { |
| 634 DEFINE_STATIC_LOCAL(PaintPropertyTreeBuilderContext, dummyContext, ()); | 634 DEFINE_STATIC_LOCAL(PaintPropertyTreeBuilderContext, dummyContext, ()); |
| 635 return dummyContext; | 635 return dummyContext; |
| 636 } | 636 } |
| 637 | 637 |
| 638 static GeometryMapper& dummyGeometryMapper() { | |
| 639 DEFINE_STATIC_LOCAL(std::unique_ptr<GeometryMapper>, dummyMapper, | |
| 640 (GeometryMapper::create())); | |
| 641 return *dummyMapper; | |
| 642 } | |
| 643 | |
| 644 PaintInvalidatorContextAdapter::PaintInvalidatorContextAdapter( | 638 PaintInvalidatorContextAdapter::PaintInvalidatorContextAdapter( |
| 645 const PaintInvalidationState& paintInvalidationState) | 639 const PaintInvalidationState& paintInvalidationState) |
| 646 // The dummy parameters will be never used because the overriding | 640 // The dummy parameters will be never used because the overriding |
| 647 // mapLocalRectToVisualRectInBacking() uses PaintInvalidationState. | 641 // mapLocalRectToVisualRectInBacking() uses PaintInvalidationState. |
| 648 : PaintInvalidatorContext(dummyTreeBuilderContext(), dummyGeometryMapper()), | 642 : PaintInvalidatorContext(dummyTreeBuilderContext()), |
| 649 m_paintInvalidationState(paintInvalidationState) { | 643 m_paintInvalidationState(paintInvalidationState) { |
| 650 forcedSubtreeInvalidationFlags = | 644 forcedSubtreeInvalidationFlags = |
| 651 paintInvalidationState.m_forcedSubtreeInvalidationFlags; | 645 paintInvalidationState.m_forcedSubtreeInvalidationFlags; |
| 652 paintInvalidationContainer = | 646 paintInvalidationContainer = |
| 653 &paintInvalidationState.paintInvalidationContainer(); | 647 &paintInvalidationState.paintInvalidationContainer(); |
| 654 paintingLayer = &paintInvalidationState.paintingLayer(); | 648 paintingLayer = &paintInvalidationState.paintingLayer(); |
| 655 } | 649 } |
| 656 | 650 |
| 657 void PaintInvalidatorContextAdapter::mapLocalRectToVisualRectInBacking( | 651 void PaintInvalidatorContextAdapter::mapLocalRectToVisualRectInBacking( |
| 658 const LayoutObject& object, | 652 const LayoutObject& object, |
| 659 LayoutRect& rect) const { | 653 LayoutRect& rect) const { |
| 660 DCHECK(&object == &m_paintInvalidationState.currentObject()); | 654 DCHECK(&object == &m_paintInvalidationState.currentObject()); |
| 661 m_paintInvalidationState.mapLocalRectToVisualRectInBacking(rect); | 655 m_paintInvalidationState.mapLocalRectToVisualRectInBacking(rect); |
| 662 } | 656 } |
| 663 | 657 |
| 664 } // namespace blink | 658 } // namespace blink |
| OLD | NEW |