| 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 16 matching lines...) Expand all Loading... |
| 27 { | 27 { |
| 28 if (!layer.paintsWithFilters()) | 28 if (!layer.paintsWithFilters()) |
| 29 return; | 29 return; |
| 30 | 30 |
| 31 FilterEffect* lastEffect = layer.lastFilterEffect(); | 31 FilterEffect* lastEffect = layer.lastFilterEffect(); |
| 32 if (!lastEffect) | 32 if (!lastEffect) |
| 33 return; | 33 return; |
| 34 | 34 |
| 35 DCHECK(layer.filterInfo()); | 35 DCHECK(layer.filterInfo()); |
| 36 | 36 |
| 37 lastEffect->determineFilterPrimitiveSubregion(MapRectForward); | 37 lastEffect->determineMaximumEffectRect(MapRectForward); |
| 38 sk_sp<SkImageFilter> imageFilter = SkiaImageFilterBuilder::build(lastEffect,
ColorSpaceDeviceRGB); | 38 sk_sp<SkImageFilter> imageFilter = SkiaImageFilterBuilder::build(lastEffect,
ColorSpaceDeviceRGB); |
| 39 if (!imageFilter) | 39 if (!imageFilter) |
| 40 return; | 40 return; |
| 41 | 41 |
| 42 // We'll handle clipping to the dirty rect before filter rasterization. | 42 // We'll handle clipping to the dirty rect before filter rasterization. |
| 43 // Filter processing will automatically expand the clip rect and the offscre
en to accommodate any filter outsets. | 43 // Filter processing will automatically expand the clip rect and the offscre
en to accommodate any filter outsets. |
| 44 // FIXME: It is incorrect to just clip to the damageRect here once multiple
fragments are involved. | 44 // FIXME: It is incorrect to just clip to the damageRect here once multiple
fragments are involved. |
| 45 | 45 |
| 46 // Subsequent code should not clip to the dirty rect, since we've already | 46 // Subsequent code should not clip to the dirty rect, since we've already |
| 47 // done it above, and doing it later will defeat the outsets. | 47 // done it above, and doing it later will defeat the outsets. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 77 | 77 |
| 78 FilterPainter::~FilterPainter() | 78 FilterPainter::~FilterPainter() |
| 79 { | 79 { |
| 80 if (!m_filterInProgress) | 80 if (!m_filterInProgress) |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); | 83 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject
); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |