| 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 "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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // clipped, so a blurred "B" may still be invisible. | 461 // clipped, so a blurred "B" may still be invisible. |
| 462 if (!filter.isEmpty()) { | 462 if (!filter.isEmpty()) { |
| 463 effectNodeNeeded = true; | 463 effectNodeNeeded = true; |
| 464 outputClip = context.current.clip; | 464 outputClip = context.current.clip; |
| 465 | 465 |
| 466 // TODO(trchen): A filter may contain spatial operations such that an | 466 // TODO(trchen): A filter may contain spatial operations such that an |
| 467 // output pixel may depend on an input pixel outside of the output clip. | 467 // output pixel may depend on an input pixel outside of the output clip. |
| 468 // We should generate a special clip node to represent this expansion. | 468 // We should generate a special clip node to represent this expansion. |
| 469 } | 469 } |
| 470 | 470 |
| 471 CompositingReasons compositingReasons = |
| 472 CompositingReasonFinder::requiresCompositingForEffectAnimation( |
| 473 object.styleRef()); |
| 474 if (compositingReasons != CompositingReasonNone) |
| 475 effectNodeNeeded = true; |
| 476 |
| 471 if (effectNodeNeeded) { | 477 if (effectNodeNeeded) { |
| 472 auto& properties = object.getMutableForPainting().ensurePaintProperties(); | 478 auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| 473 context.forceSubtreeUpdate |= properties.updateEffect( | 479 context.forceSubtreeUpdate |= properties.updateEffect( |
| 474 context.currentEffect, context.current.transform, outputClip, | 480 context.currentEffect, context.current.transform, outputClip, |
| 475 std::move(filter), opacity, blendMode); | 481 std::move(filter), opacity, blendMode, compositingReasons); |
| 476 } else { | 482 } else { |
| 477 if (auto* properties = object.getMutableForPainting().paintProperties()) | 483 if (auto* properties = object.getMutableForPainting().paintProperties()) |
| 478 context.forceSubtreeUpdate |= properties->clearEffect(); | 484 context.forceSubtreeUpdate |= properties->clearEffect(); |
| 479 } | 485 } |
| 480 } | 486 } |
| 481 | 487 |
| 482 const auto* properties = object.paintProperties(); | 488 const auto* properties = object.paintProperties(); |
| 483 if (properties && properties->effect()) { | 489 if (properties && properties->effect()) { |
| 484 context.currentEffect = properties->effect(); | 490 context.currentEffect = properties->effect(); |
| 485 if (!properties->effect()->filter().isEmpty()) { | 491 if (!properties->effect()->filter().isEmpty()) { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 updateOverflowClip(object, context); | 969 updateOverflowClip(object, context); |
| 964 updatePerspective(object, context); | 970 updatePerspective(object, context); |
| 965 updateSvgLocalToBorderBoxTransform(object, context); | 971 updateSvgLocalToBorderBoxTransform(object, context); |
| 966 updateScrollAndScrollTranslation(object, context); | 972 updateScrollAndScrollTranslation(object, context); |
| 967 updateOutOfFlowContext(object, context); | 973 updateOutOfFlowContext(object, context); |
| 968 | 974 |
| 969 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 975 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 970 } | 976 } |
| 971 | 977 |
| 972 } // namespace blink | 978 } // namespace blink |
| OLD | NEW |