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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // to accommodate any filter outsets. | 46 // to accommodate any filter outsets. |
47 // FIXME: It is incorrect to just clip to the damageRect here once multiple | 47 // FIXME: It is incorrect to just clip to the damageRect here once multiple |
48 // fragments are involved. | 48 // fragments are involved. |
49 | 49 |
50 // Subsequent code should not clip to the dirty rect, since we've already | 50 // Subsequent code should not clip to the dirty rect, since we've already |
51 // done it above, and doing it later will defeat the outsets. | 51 // done it above, and doing it later will defeat the outsets. |
52 paintingInfo.clipToDirtyRect = false; | 52 paintingInfo.clipToDirtyRect = false; |
53 | 53 |
54 DCHECK(m_layoutObject); | 54 DCHECK(m_layoutObject); |
55 | 55 |
56 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius()) | 56 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius()) { |
57 m_clipRecorder = wrapUnique(new LayerClipRecorder( | 57 m_clipRecorder = wrapUnique(new LayerClipRecorder( |
58 context, *layer.layoutObject(), DisplayItem::kClipLayerFilter, clipRect, | 58 context, *layer.layoutObject(), DisplayItem::kClipLayerFilter, clipRect, |
59 &paintingInfo, LayoutPoint(), paintFlags)); | 59 paintingInfo.rootLayer, LayoutPoint(), paintFlags)); |
| 60 } |
60 | 61 |
61 if (!context.getPaintController().displayItemConstructionIsDisabled()) { | 62 if (!context.getPaintController().displayItemConstructionIsDisabled()) { |
62 CompositorFilterOperations compositorFilterOperations = | 63 CompositorFilterOperations compositorFilterOperations = |
63 layer.createCompositorFilterOperationsForFilter( | 64 layer.createCompositorFilterOperationsForFilter( |
64 m_layoutObject->styleRef()); | 65 m_layoutObject->styleRef()); |
65 // FIXME: It's possible to have empty CompositorFilterOperations here even | 66 // FIXME: It's possible to have empty CompositorFilterOperations here even |
66 // though the SkImageFilter produced above is non-null, since the | 67 // though the SkImageFilter produced above is non-null, since the |
67 // layer's FilterEffectBuilder can have a stale representation of | 68 // layer's FilterEffectBuilder can have a stale representation of |
68 // the layer's filter. See crbug.com/502026. | 69 // the layer's filter. See crbug.com/502026. |
69 if (compositorFilterOperations.isEmpty()) | 70 if (compositorFilterOperations.isEmpty()) |
(...skipping 17 matching lines...) Expand all Loading... |
87 } | 88 } |
88 | 89 |
89 FilterPainter::~FilterPainter() { | 90 FilterPainter::~FilterPainter() { |
90 if (!m_filterInProgress) | 91 if (!m_filterInProgress) |
91 return; | 92 return; |
92 | 93 |
93 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject); | 94 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject); |
94 } | 95 } |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
OLD | NEW |