| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 if (properties && properties->cssClip()) | 676 if (properties && properties->cssClip()) |
| 677 context.current.clip = properties->cssClip(); | 677 context.current.clip = properties->cssClip(); |
| 678 } | 678 } |
| 679 | 679 |
| 680 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext( | 680 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext( |
| 681 const LayoutObject& object, | 681 const LayoutObject& object, |
| 682 PaintPropertyTreeBuilderContext& context) { | 682 PaintPropertyTreeBuilderContext& context) { |
| 683 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate) | 683 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate) |
| 684 return; | 684 return; |
| 685 | 685 |
| 686 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since | 686 // We need localBorderBoxProperties for layered objects only. |
| 687 // we don't need them at the moment. | 687 if (!object.hasLayer()) { |
| 688 if (!object.isBox() && !object.hasLayer()) { | |
| 689 if (auto* properties = object.getMutableForPainting().paintProperties()) | 688 if (auto* properties = object.getMutableForPainting().paintProperties()) |
| 690 properties->clearLocalBorderBoxProperties(); | 689 properties->clearLocalBorderBoxProperties(); |
| 691 } else { | 690 } else { |
| 692 auto& properties = object.getMutableForPainting().ensurePaintProperties(); | 691 auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| 693 properties.updateLocalBorderBoxProperties( | 692 properties.updateLocalBorderBoxProperties( |
| 694 context.current.transform, context.current.clip, context.currentEffect); | 693 context.current.transform, context.current.clip, context.currentEffect); |
| 695 } | 694 } |
| 696 } | 695 } |
| 697 | 696 |
| 698 // TODO(trchen): Remove this once we bake the paint offset into frameRect. | 697 // TODO(trchen): Remove this once we bake the paint offset into frameRect. |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 updateOverflowClip(object, context); | 1124 updateOverflowClip(object, context); |
| 1126 updatePerspective(object, context); | 1125 updatePerspective(object, context); |
| 1127 updateSvgLocalToBorderBoxTransform(object, context); | 1126 updateSvgLocalToBorderBoxTransform(object, context); |
| 1128 updateScrollAndScrollTranslation(object, context); | 1127 updateScrollAndScrollTranslation(object, context); |
| 1129 updateOutOfFlowContext(object, context); | 1128 updateOutOfFlowContext(object, context); |
| 1130 | 1129 |
| 1131 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1130 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 1132 } | 1131 } |
| 1133 | 1132 |
| 1134 } // namespace blink | 1133 } // namespace blink |
| OLD | NEW |