| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/SVGFilterPainter.h" | 5 #include "core/paint/SVGFilterPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/svg/LayoutSVGResourceFilter.h" | 7 #include "core/layout/svg/LayoutSVGResourceFilter.h" |
| 8 #include "core/paint/FilterEffectBuilder.h" | 8 #include "core/paint/FilterEffectBuilder.h" |
| 9 #include "core/paint/LayoutObjectDrawingRecorder.h" | 9 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 10 #include "core/svg/SVGFilterElement.h" | 10 #include "core/svg/SVGFilterElement.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Check for RecordingContent here because we may can be re-painting | 145 // Check for RecordingContent here because we may can be re-painting |
| 146 // without re-recording the contents to be filtered. | 146 // without re-recording the contents to be filtered. |
| 147 Filter* filter = filter_data->last_effect->GetFilter(); | 147 Filter* filter = filter_data->last_effect->GetFilter(); |
| 148 FloatRect bounds = filter->FilterRegion(); | 148 FloatRect bounds = filter->FilterRegion(); |
| 149 if (filter_data->state_ == FilterData::kRecordingContent) { | 149 if (filter_data->state_ == FilterData::kRecordingContent) { |
| 150 DCHECK(filter->GetSourceGraphic()); | 150 DCHECK(filter->GetSourceGraphic()); |
| 151 sk_sp<PaintRecord> content = recording_context.EndContent(bounds); | 151 sk_sp<PaintRecord> content = recording_context.EndContent(bounds); |
| 152 SkiaImageFilterBuilder::BuildSourceGraphic(filter->GetSourceGraphic(), | 152 SkiaImageFilterBuilder::BuildSourceGraphic(filter->GetSourceGraphic(), |
| 153 std::move(content)); | 153 std::move(content), bounds); |
| 154 filter_data->state_ = FilterData::kReadyToPaint; | 154 filter_data->state_ = FilterData::kReadyToPaint; |
| 155 } | 155 } |
| 156 | 156 |
| 157 DCHECK_EQ(filter_data->state_, FilterData::kReadyToPaint); | 157 DCHECK_EQ(filter_data->state_, FilterData::kReadyToPaint); |
| 158 filter_data->state_ = FilterData::kPaintingFilter; | 158 filter_data->state_ = FilterData::kPaintingFilter; |
| 159 PaintFilteredContent(recording_context.PaintingContext(), object, bounds, | 159 PaintFilteredContent(recording_context.PaintingContext(), object, bounds, |
| 160 filter_data->last_effect); | 160 filter_data->last_effect); |
| 161 filter_data->state_ = FilterData::kReadyToPaint; | 161 filter_data->state_ = FilterData::kReadyToPaint; |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace blink | 164 } // namespace blink |
| OLD | NEW |