| 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 18 matching lines...) Expand all Loading... |
| 29 : m_filterInProgress(false), | 29 : m_filterInProgress(false), |
| 30 m_context(context), | 30 m_context(context), |
| 31 m_layoutObject(layer.layoutObject()) { | 31 m_layoutObject(layer.layoutObject()) { |
| 32 if (!layer.paintsWithFilters()) | 32 if (!layer.paintsWithFilters()) |
| 33 return; | 33 return; |
| 34 | 34 |
| 35 FilterEffect* lastEffect = layer.lastFilterEffect(); | 35 FilterEffect* lastEffect = layer.lastFilterEffect(); |
| 36 if (!lastEffect) | 36 if (!lastEffect) |
| 37 return; | 37 return; |
| 38 | 38 |
| 39 DCHECK(layer.filterInfo()); | |
| 40 | |
| 41 sk_sp<SkImageFilter> imageFilter = | 39 sk_sp<SkImageFilter> imageFilter = |
| 42 SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB); | 40 SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB); |
| 43 if (!imageFilter) | 41 if (!imageFilter) |
| 44 return; | 42 return; |
| 45 | 43 |
| 46 // We'll handle clipping to the dirty rect before filter rasterization. | 44 // We'll handle clipping to the dirty rect before filter rasterization. |
| 47 // Filter processing will automatically expand the clip rect and the offscreen | 45 // Filter processing will automatically expand the clip rect and the offscreen |
| 48 // to accommodate any filter outsets. | 46 // to accommodate any filter outsets. |
| 49 // 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 |
| 50 // fragments are involved. | 48 // fragments are involved. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 87 } |
| 90 | 88 |
| 91 FilterPainter::~FilterPainter() { | 89 FilterPainter::~FilterPainter() { |
| 92 if (!m_filterInProgress) | 90 if (!m_filterInProgress) |
| 93 return; | 91 return; |
| 94 | 92 |
| 95 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject); | 93 m_context.getPaintController().endItem<EndFilterDisplayItem>(*m_layoutObject); |
| 96 } | 94 } |
| 97 | 95 |
| 98 } // namespace blink | 96 } // namespace blink |
| OLD | NEW |