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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Subsequent code should not clip to the dirty rect, since we've already | 53 // Subsequent code should not clip to the dirty rect, since we've already |
54 // done it above, and doing it later will defeat the outsets. | 54 // done it above, and doing it later will defeat the outsets. |
55 paintingInfo.clipToDirtyRect = false; | 55 paintingInfo.clipToDirtyRect = false; |
56 | 56 |
57 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
{ | 57 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
{ |
58 m_clipRecorder = adoptPtr(new LayerClipRecorder(context, *layer.layoutOb
ject(), DisplayItem::ClipLayerFilter, clipRect, &paintingInfo, LayoutPoint(), pa
intFlags)); | 58 m_clipRecorder = adoptPtr(new LayerClipRecorder(context, *layer.layoutOb
ject(), DisplayItem::ClipLayerFilter, clipRect, &paintingInfo, LayoutPoint(), pa
intFlags)); |
59 } | 59 } |
60 | 60 |
61 ASSERT(m_layoutObject); | 61 ASSERT(m_layoutObject); |
| 62 |
62 if (!context.getPaintController().displayItemConstructionIsDisabled()) { | 63 if (!context.getPaintController().displayItemConstructionIsDisabled()) { |
63 FilterOperations filterOperations(layer.computeFilterOperations(m_layout
Object->styleRef())); | 64 FilterOperations filterOperations(layer.computeFilterOperations(m_layout
Object->styleRef())); |
64 OwnPtr<CompositorFilterOperations> compositorFilterOperations = adoptPtr
(CompositorFactory::current().createFilterOperations()); | 65 OwnPtr<CompositorFilterOperations> compositorFilterOperations = adoptPtr
(CompositorFactory::current().createFilterOperations()); |
65 SkiaImageFilterBuilder::buildFilterOperations(filterOperations, composit
orFilterOperations.get()); | 66 SkiaImageFilterBuilder::buildFilterOperations(filterOperations, composit
orFilterOperations.get()); |
66 // FIXME: It's possible to have empty CompositorFilterOperations here ev
en | 67 // FIXME: It's possible to have empty CompositorFilterOperations here ev
en |
67 // though the SkImageFilter produced above is non-null, since the | 68 // though the SkImageFilter produced above is non-null, since the |
68 // layer's FilterEffectBuilder can have a stale representation of | 69 // layer's FilterEffectBuilder can have a stale representation of |
69 // the layer's filter. See crbug.com/502026. | 70 // the layer's filter. See crbug.com/502026. |
70 if (compositorFilterOperations->isEmpty()) | 71 if (compositorFilterOperations->isEmpty()) |
71 return; | 72 return; |
(...skipping 11 matching lines...) Expand all Loading... |
83 | 84 |
84 FilterPainter::~FilterPainter() | 85 FilterPainter::~FilterPainter() |
85 { | 86 { |
86 if (!m_filterInProgress) | 87 if (!m_filterInProgress) |
87 return; | 88 return; |
88 | 89 |
89 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); | 90 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); |
90 } | 91 } |
91 | 92 |
92 } // namespace blink | 93 } // namespace blink |
OLD | NEW |