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/paint/FilterPainter.h" | 5 #include "core/paint/FilterPainter.h" |
6 | 6 |
7 #include "core/paint/FilterEffectBuilder.h" | 7 #include "core/paint/FilterEffectBuilder.h" |
8 #include "core/paint/LayerClipRecorder.h" | 8 #include "core/paint/LayerClipRecorder.h" |
9 #include "core/paint/PaintLayer.h" | 9 #include "core/paint/PaintLayer.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // layer's FilterEffectBuilder can have a stale representation of | 69 // layer's FilterEffectBuilder can have a stale representation of |
70 // the layer's filter. See crbug.com/502026. | 70 // the layer's filter. See crbug.com/502026. |
71 if (compositorFilterOperations.isEmpty()) | 71 if (compositorFilterOperations.isEmpty()) |
72 return; | 72 return; |
73 LayoutRect visualBounds(rootRelativeBounds); | 73 LayoutRect visualBounds(rootRelativeBounds); |
74 if (layer.enclosingPaginationLayer()) { | 74 if (layer.enclosingPaginationLayer()) { |
75 // Filters are set up before pagination, so we need to make the boun
ding box visual on our own. | 75 // Filters are set up before pagination, so we need to make the boun
ding box visual on our own. |
76 visualBounds.moveBy(-offsetFromRoot); | 76 visualBounds.moveBy(-offsetFromRoot); |
77 layer.convertFromFlowThreadToVisualBoundingBoxInAncestor(paintingInf
o.rootLayer, visualBounds); | 77 layer.convertFromFlowThreadToVisualBoundingBoxInAncestor(paintingInf
o.rootLayer, visualBounds); |
78 } | 78 } |
79 context.getPaintController().createAndAppend<BeginFilterDisplayItem>(*m_
layoutObject, std::move(imageFilter), FloatRect(visualBounds), std::move(composi
torFilterOperations)); | 79 FloatPoint origin(offsetFromRoot); |
| 80 context.getPaintController().createAndAppend<BeginFilterDisplayItem>(*m_
layoutObject, std::move(imageFilter), FloatRect(visualBounds), origin, std::move
(compositorFilterOperations)); |
80 } | 81 } |
81 | 82 |
82 m_filterInProgress = true; | 83 m_filterInProgress = true; |
83 } | 84 } |
84 | 85 |
85 FilterPainter::~FilterPainter() | 86 FilterPainter::~FilterPainter() |
86 { | 87 { |
87 if (!m_filterInProgress) | 88 if (!m_filterInProgress) |
88 return; | 89 return; |
89 | 90 |
90 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); | 91 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); |
91 } | 92 } |
92 | 93 |
93 } // namespace blink | 94 } // namespace blink |
OLD | NEW |