Changeset 286546 in webkit
- Timestamp:
- Dec 6, 2021, 10:20:43 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSFilterImageValue.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/filters/Filter.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/filters/Filter.h (modified) (1 diff)
-
Source/WebCore/rendering/CSSFilter.cpp (modified) (8 diffs)
-
Source/WebCore/rendering/CSSFilter.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderLayerFilters.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderLayerFilters.h (modified) (2 diffs)
-
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp (modified) (1 diff)
-
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (modified) (1 diff)
-
Source/WebCore/svg/graphics/filters/SVGFilter.cpp (modified) (2 diffs)
-
Source/WebCore/svg/graphics/filters/SVGFilter.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286532 r286546 1 2021-12-06 Said Abou-Hallawa <said@apple.com> 2 3 [GPU Process] (REGRESSION r285597): Set the filterRegion of the CSSFilter after it is created 4 https://bugs.webkit.org/show_bug.cgi?id=233849 5 6 Reviewed by Cameron McCormack. 7 8 Unskip layout tests which were skipped in r285597. 9 10 * TestExpectations: 11 1 12 2021-12-04 Antoine Quint <graouts@webkit.org> 2 13 -
trunk/LayoutTests/TestExpectations
r286526 r286546 5164 5164 js/dom/reflect-set-onto-dom.html [ Skip ] 5165 5165 userscripts/user-script-plugin-document.html [ Skip ] 5166 5167 # These filter related failures should be fixed once webkit.org/b/232705 is resolved5168 webkit.org/b/232705 compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow.html [ Skip ]5169 webkit.org/b/232705 compositing/filters/sw-shadow-overlaps-hw-layer.html [ Skip ]5170 webkit.org/b/232705 compositing/filters/sw-shadow-overlaps-hw-shadow.html [ Skip ]5171 webkit.org/b/232705 css3/filters/effect-reference-delete.html [ Skip ]5172 webkit.org/b/232705 css3/filters/svg-blur-filter-clipped.html [ Skip ]5173 webkit.org/b/232705 fast/filter-image/background-filter-image.html [ Skip ]5174 webkit.org/b/232705 fast/filter-image/filter-image-blur.html [ Skip ]5175 webkit.org/b/232705 fast/filter-image/filter-image-svg.html [ Skip ]5176 webkit.org/b/232705 fast/filter-image/filter-image.html [ Skip ]5177 webkit.org/b/232705 imported/mozilla/svg/dynamic-filter-contents-01a.svg [ Skip ]5178 webkit.org/b/232705 imported/mozilla/svg/filters/feComposite-2.svg [ Skip ]5179 webkit.org/b/232705 imported/mozilla/svg/filters/feSpecularLighting-1.svg [ Skip ]5180 webkit.org/b/232705 svg/custom/resources-css-scaled.html [ Skip ]5181 webkit.org/b/232705 svg/filters/feLighting-clipped.svg [ Skip ] -
trunk/Source/WebCore/ChangeLog
r286545 r286546 1 2021-12-06 Said Abou-Hallawa <said@apple.com> 2 [GPU Process] (REGRESSION r285597): Set the filterRegion of the CSSFilter after it is created 3 https://bugs.webkit.org/show_bug.cgi?id=233849 4 5 Reviewed by Cameron McCormack. 6 7 In this patch: 8 9 1. sourceImageRect is no longer passed as an argument to SVGFilter. It 10 should be passed only when SVGFilter::apply() is called. 11 12 2. CSSFilter::create() will create and build the FilterFunctions from the 13 FilterOperations. So we have to pass the targetBoundingBox since the 14 FilterEffects will need it when calculating the outsets. 15 16 3. The steps in RenderLayerFilters::beginFilterEffect() are: 17 a) Recreate the CSSFilter if the targetBoundingBox changes. 18 b) Calculate the filterRegion = targetBoundingBox + outsets 19 c) Clamp the filterRegion if needed. This will change the filterScale. 20 d) Set sourceImageRect = filterRegion. 21 e) Recreate the sourceImage if needed. 22 f) setup the context for drawing the target renderer. 23 24 4. Managing the targetBoundingBox and the filterRegion is moved from 25 CSSFilter to RenderLayerFilters. 26 27 * css/CSSFilterImageValue.cpp: 28 (WebCore::CSSFilterImageValue::image): 29 * platform/graphics/filters/Filter.cpp: 30 (WebCore::Filter::Filter): 31 * platform/graphics/filters/Filter.h: 32 (WebCore::Filter::Filter): 33 * rendering/CSSFilter.cpp: 34 (WebCore::CSSFilter::create): 35 (WebCore::CSSFilter::CSSFilter): 36 (WebCore::createSVGFilter): 37 (WebCore::CSSFilter::buildFilterFunctions): 38 (WebCore::CSSFilter::apply): 39 (WebCore::CSSFilter::setFilterRegion): 40 (WebCore::m_hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted. 41 (WebCore::CSSFilter::updateBackingStoreRect): Deleted. 42 (WebCore::CSSFilter::computeSourceImageRectForDirtyRect): Deleted. 43 (WebCore::CSSFilter::setSourceImageRect): Deleted. 44 * rendering/CSSFilter.h: 45 * rendering/RenderLayerFilters.cpp: 46 (WebCore::RenderLayerFilters::buildFilter): 47 (WebCore::RenderLayerFilters::allocateBackingStoreIfNeeded): 48 (WebCore::RenderLayerFilters::beginFilterEffect): 49 (WebCore::RenderLayerFilters::applyFilterEffect): 50 (WebCore::RenderLayerFilters::allocateBackingStore): Deleted. 51 * rendering/RenderLayerFilters.h: 52 * rendering/svg/RenderSVGResourceFilter.cpp: 53 (WebCore::RenderSVGResourceFilter::applyResource): 54 * rendering/svg/SVGRenderTreeAsText.cpp: 55 (WebCore::writeSVGResourceContainer): 56 * svg/graphics/filters/SVGFilter.cpp: 57 (WebCore::SVGFilter::create): 58 (WebCore::SVGFilter::SVGFilter): 59 * svg/graphics/filters/SVGFilter.h: 60 1 61 2021-12-06 Alex Christensen <achristensen@webkit.org> 2 62 -
trunk/Source/WebCore/css/CSSFilterImageValue.cpp
r286287 r286546 125 125 sourceImage->context().drawImage(*image, sourceImageRect); 126 126 127 auto cssFilter = CSSFilter::create(m_filterOperations, renderingMode); 127 auto cssFilter = CSSFilter::create(renderer, m_filterOperations, renderingMode, FloatSize { 1, 1 }, Filter::ClipOperation::Intersect, sourceImageRect); 128 if (!cssFilter) 129 return &Image::nullImage(); 128 130 129 cssFilter->setSourceImageRect(sourceImageRect); 130 if (!cssFilter->buildFilterFunctions(renderer, m_filterOperations)) 131 return &Image::nullImage(); 131 cssFilter->setFilterRegion(sourceImageRect); 132 132 133 133 if (auto image = sourceImage->filteredImage(*cssFilter)) -
trunk/Source/WebCore/platform/graphics/filters/Filter.cpp
r286538 r286546 33 33 namespace WebCore { 34 34 35 Filter::Filter(Filter::Type filterType, RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation )35 Filter::Filter(Filter::Type filterType, RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, const FloatRect& filterRegion) 36 36 : FilterFunction(filterType) 37 37 , m_renderingMode(renderingMode) 38 38 , m_filterScale(filterScale) 39 39 , m_clipOperation(clipOperation) 40 {41 }42 43 Filter::Filter(Filter::Type filterType, RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation clipOperation)44 : FilterFunction(filterType)45 , m_renderingMode(renderingMode)46 , m_filterScale(filterScale)47 , m_sourceImageRect(sourceImageRect)48 40 , m_filterRegion(filterRegion) 49 , m_clipOperation(clipOperation)50 41 { 51 42 } -
trunk/Source/WebCore/platform/graphics/filters/Filter.h
r286538 r286546 78 78 protected: 79 79 using FilterFunction::FilterFunction; 80 Filter(Filter::Type, RenderingMode, const FloatSize& filterScale, ClipOperation = ClipOperation::Intersect); 81 Filter(Filter::Type, RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation = ClipOperation::Intersect); 80 Filter(Filter::Type, RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& filterRegion = { }); 82 81 83 82 private: 84 83 RenderingMode m_renderingMode; 85 86 84 FloatSize m_filterScale; 87 FloatRect m_sourceImageRect;85 ClipOperation m_clipOperation; 88 86 FloatRect m_filterRegion; 89 87 88 // FIXME: these should not be members of Filter. They should be passed to Filter::apply(). 89 FloatRect m_sourceImageRect; 90 90 RefPtr<ImageBuffer> m_sourceImage; 91 92 ClipOperation m_clipOperation;93 91 }; 94 92 -
trunk/Source/WebCore/rendering/CSSFilter.cpp
r286538 r286546 45 45 namespace WebCore { 46 46 47 RefPtr<CSSFilter> CSSFilter::create( const FilterOperations& operations, RenderingMode renderingMode, float scaleFactor, ClipOperation clipOperation)47 RefPtr<CSSFilter> CSSFilter::create(RenderElement& renderer, const FilterOperations& operations, RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, const FloatRect& targetBoundingBox) 48 48 { 49 49 bool hasFilterThatMovesPixels = operations.hasFilterThatMovesPixels(); 50 50 bool hasFilterThatShouldBeRestrictedBySecurityOrigin = operations.hasFilterThatShouldBeRestrictedBySecurityOrigin(); 51 51 52 return adoptRef(*new CSSFilter(renderingMode, scaleFactor, clipOperation, hasFilterThatMovesPixels, hasFilterThatShouldBeRestrictedBySecurityOrigin)); 52 auto filter = adoptRef(*new CSSFilter(renderingMode, filterScale, clipOperation, hasFilterThatMovesPixels, hasFilterThatShouldBeRestrictedBySecurityOrigin)); 53 54 if (!filter->buildFilterFunctions(renderer, operations, targetBoundingBox)) 55 return nullptr; 56 57 return filter; 53 58 } 54 59 … … 58 63 } 59 64 60 CSSFilter::CSSFilter(RenderingMode renderingMode, float scaleFactor, ClipOperation clipOperation, bool hasFilterThatMovesPixels, bool hasFilterThatShouldBeRestrictedBySecurityOrigin)61 : Filter(Filter::Type::CSSFilter, renderingMode, FloatSize { scaleFactor, scaleFactor }, clipOperation)65 CSSFilter::CSSFilter(RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, bool hasFilterThatMovesPixels, bool hasFilterThatShouldBeRestrictedBySecurityOrigin) 66 : Filter(Filter::Type::CSSFilter, renderingMode, filterScale, clipOperation) 62 67 , m_hasFilterThatMovesPixels(hasFilterThatMovesPixels) 63 68 , m_hasFilterThatShouldBeRestrictedBySecurityOrigin(hasFilterThatShouldBeRestrictedBySecurityOrigin) … … 214 219 } 215 220 216 static RefPtr<SVGFilter> createSVGFilter(CSSFilter& filter, const ReferenceFilterOperation& filterOperation, RenderElement& renderer, FilterEffect& previousEffect)221 static RefPtr<SVGFilter> createSVGFilter(CSSFilter& filter, const ReferenceFilterOperation& filterOperation, RenderElement& renderer, const FloatRect& targetBoundingBox, FilterEffect& previousEffect) 217 222 { 218 223 auto& referencedSVGResources = renderer.ensureReferencedSVGResources(); … … 228 233 229 234 SVGFilterBuilder builder; 230 return SVGFilter::create(*filterElement, builder, filter.renderingMode(), filter.filterScale(), filter. sourceImageRect(), filter.filterRegion(), filter.clipOperation(), previousEffect);231 } 232 233 bool CSSFilter::buildFilterFunctions(RenderElement& renderer, const FilterOperations& operations )235 return SVGFilter::create(*filterElement, builder, filter.renderingMode(), filter.filterScale(), filter.clipOperation(), targetBoundingBox, previousEffect); 236 } 237 238 bool CSSFilter::buildFilterFunctions(RenderElement& renderer, const FilterOperations& operations, const FloatRect& targetBoundingBox) 234 239 { 235 240 m_functions.clear(); … … 288 293 289 294 case FilterOperation::REFERENCE: 290 filter = createSVGFilter(*this, downcast<ReferenceFilterOperation>(*operation), renderer, *previousEffect);295 filter = createSVGFilter(*this, downcast<ReferenceFilterOperation>(*operation), renderer, targetBoundingBox, *previousEffect); 291 296 effect = nullptr; 292 297 break; … … 331 336 } 332 337 333 bool CSSFilter::updateBackingStoreRect(const FloatRect& filterRect)334 {335 if (filterRect.isEmpty() || ImageBuffer::sizeNeedsClamping(filterRect.size()))336 return false;337 338 if (filterRect == sourceImageRect())339 return false;340 341 setSourceImageRect(filterRect);342 return true;343 }344 345 338 RefPtr<FilterEffect> CSSFilter::lastEffect() const 346 339 { … … 379 372 { 380 373 for (auto& function : m_functions) { 374 if (function->isSVGFilter()) 375 downcast<SVGFilter>(function.ptr())->setSourceImageRect(sourceImageRect()); 381 376 if (!function->apply(*this)) 382 377 return nullptr; … … 385 380 } 386 381 387 LayoutRect CSSFilter::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect) 388 { 389 // The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect". 390 auto rectForRepaint = dirtyRect; 391 if (hasFilterThatMovesPixels()) 392 rectForRepaint += outsets(); 393 rectForRepaint.intersect(filterBoxRect); 394 return rectForRepaint; 395 } 396 397 void CSSFilter::setSourceImageRect(const FloatRect& sourceImageRect) 398 { 399 Filter::setFilterRegion(sourceImageRect); 400 Filter::setSourceImageRect(sourceImageRect); 382 void CSSFilter::setFilterRegion(const FloatRect& filterRegion) 383 { 384 Filter::setFilterRegion(filterRegion); 401 385 402 386 for (auto& function : m_functions) { 403 if (function->isSVGFilter()) { 404 downcast<SVGFilter>(function.ptr())->setFilterRegion(sourceImageRect); 405 downcast<SVGFilter>(function.ptr())->setSourceImageRect(sourceImageRect); 406 } 387 if (function->isSVGFilter()) 388 downcast<SVGFilter>(function.ptr())->setFilterRegion(filterRegion); 407 389 } 390 391 clampFilterRegionIfNeeded(); 408 392 } 409 393 -
trunk/Source/WebCore/rendering/CSSFilter.h
r286538 r286546 43 43 WTF_MAKE_FAST_ALLOCATED; 44 44 public: 45 static RefPtr<CSSFilter> create( const FilterOperations&, RenderingMode, float scaleFactor = 1, ClipOperation = ClipOperation::Intersect);45 static RefPtr<CSSFilter> create(RenderElement&, const FilterOperations&, RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& targetBoundingBox); 46 46 WEBCORE_EXPORT static RefPtr<CSSFilter> create(Vector<Ref<FilterFunction>>&&); 47 47 48 48 const Vector<Ref<FilterFunction>>& functions() const { return m_functions; } 49 49 50 void setSourceImageRect(const FloatRect&); 51 bool buildFilterFunctions(RenderElement&, const FilterOperations&); 50 void setFilterRegion(const FloatRect&); 52 51 53 52 bool hasFilterThatMovesPixels() const { return m_hasFilterThatMovesPixels; } … … 60 59 RefPtr<FilterImage> apply() final; 61 60 62 bool updateBackingStoreRect(const FloatRect& filterRect);63 64 LayoutRect computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect);65 66 61 private: 67 CSSFilter(RenderingMode, float scaleFactor, ClipOperation, bool hasFilterThatMovesPixels, bool hasFilterThatShouldBeRestrictedBySecurityOrigin);62 CSSFilter(RenderingMode, const FloatSize& filterScale, ClipOperation, bool hasFilterThatMovesPixels, bool hasFilterThatShouldBeRestrictedBySecurityOrigin); 68 63 CSSFilter(Vector<Ref<FilterFunction>>&&); 64 65 bool buildFilterFunctions(RenderElement&, const FilterOperations&, const FloatRect& targetBoundingBox); 69 66 70 67 #if USE(CORE_IMAGE) -
trunk/Source/WebCore/rendering/RenderLayerFilters.cpp
r286538 r286546 122 122 // go through regular processing (e.g. compositing), but never apply anything. 123 123 // FIXME: this rebuilds the entire effects chain even if the filter style didn't change. 124 m_filter = CSSFilter::create(renderer .style().filter(), renderingMode, scaleFactor, Filter::ClipOperation::Unite);124 m_filter = CSSFilter::create(renderer, renderer.style().filter(), renderingMode, FloatSize { scaleFactor, scaleFactor }, Filter::ClipOperation::Unite, m_targetBoundingBox); 125 125 } 126 126 … … 130 130 } 131 131 132 void RenderLayerFilters::allocateBackingStore (const GraphicsContext& targetContext)132 void RenderLayerFilters::allocateBackingStoreIfNeeded(const GraphicsContext& targetContext) 133 133 { 134 134 auto& filter = *m_filter; 135 auto logicalSize = filter.scaledByFilterScale( filter.sourceImageRect().size());135 auto logicalSize = filter.scaledByFilterScale(m_filterRegion.size()); 136 136 137 137 if (!m_sourceImage || m_sourceImage->logicalSize() != logicalSize) { … … 152 152 return nullptr; 153 153 154 // Calculate targetBoundingBox since it will be used if the filter is created. 155 auto targetBoundingBox = intersection(filterBoxRect, dirtyRect); 156 if (targetBoundingBox.isEmpty()) 157 return nullptr; 158 159 if (m_targetBoundingBox != targetBoundingBox) { 160 m_targetBoundingBox = targetBoundingBox; 161 // FIXME: this rebuilds the entire effects chain even if the filter style didn't change. 162 m_filter = CSSFilter::create(renderer, renderer.style().filter(), m_filter->renderingMode(), m_filter->filterScale(), Filter::ClipOperation::Unite, m_targetBoundingBox); 163 } 164 165 if (!m_filter) 166 return nullptr; 167 154 168 auto& filter = *m_filter; 155 auto filterSourceRect = filter.computeSourceImageRectForDirtyRect(filterBoxRect, dirtyRect); 156 if (filterSourceRect.isEmpty()) 157 return nullptr; 158 159 bool hasUpdatedBackingStore = filter.updateBackingStoreRect(filterSourceRect); 160 161 // FIXME: this call should be moved to CSSFilter::create() when FilterEffect does not store its geometry. 162 if (hasUpdatedBackingStore || !m_filter->lastEffect()) { 163 // If the filter fails to build, remove it from the layer. It will still attempt to 164 // go through regular processing (e.g. compositing), but never apply anything. 165 if (!m_filter->buildFilterFunctions(renderer, renderer.style().filter())) 166 return nullptr; 169 170 // For CSSFilter, filterRegion = targetBoundingBox + filter->outsets() 171 auto filterRegion = targetBoundingBox; 172 if (filter.hasFilterThatMovesPixels()) { 173 filterRegion += filter.outsets(); 174 filterRegion.intersect(filterBoxRect); 175 } 176 177 if (filterRegion.isEmpty()) 178 return nullptr; 179 180 // For CSSFilter, sourceImageRect = filterRegion. 181 bool hasUpdatedBackingStore = false; 182 if (m_filterRegion != filterRegion) { 183 m_filterRegion = filterRegion; 184 hasUpdatedBackingStore = true; 167 185 } 168 186 … … 171 189 else { 172 190 if (hasUpdatedBackingStore) 173 m_repaintRect = filter SourceRect;191 m_repaintRect = filterRegion; 174 192 else { 175 193 m_repaintRect = dirtyRect; 176 194 m_repaintRect.unite(layerRepaintRect); 177 m_repaintRect.intersect(filter SourceRect);195 m_repaintRect.intersect(filterRegion); 178 196 } 179 197 } 180 m_paintOffset = filterSourceRect.location(); 198 199 m_paintOffset = filterRegion.location(); 181 200 resetDirtySourceRect(); 182 201 183 filter.clampFilterRegionIfNeeded(); 184 185 if (hasUpdatedBackingStore) 186 allocateBackingStore(destinationContext); 202 filter.setFilterRegion(m_filterRegion); 203 allocateBackingStoreIfNeeded(destinationContext); 187 204 188 205 auto* sourceGraphicsContext = inputContext(); 189 if (!sourceGraphicsContext || filter.filterRegion().isEmpty() || ImageBuffer::sizeNeedsClamping(filter.filterRegion().size()))206 if (!sourceGraphicsContext) 190 207 return nullptr; 191 208 … … 208 225 auto& filter = *m_filter; 209 226 210 destinationContext.drawFilteredImageBuffer(m_sourceImage.get(), filter.sourceImageRect(), filter);227 destinationContext.drawFilteredImageBuffer(m_sourceImage.get(), m_filterRegion, filter); 211 228 filter.clearIntermediateResults(); 212 229 -
trunk/Source/WebCore/rendering/RenderLayerFilters.h
r286203 r286546 71 71 void resetDirtySourceRect() { m_dirtySourceRect = LayoutRect(); } 72 72 GraphicsContext* inputContext(); 73 void allocateBackingStore (const GraphicsContext& targetContext);73 void allocateBackingStoreIfNeeded(const GraphicsContext& targetContext); 74 74 75 75 RenderLayer& m_layer; … … 78 78 Vector<CachedResourceHandle<CachedSVGDocument>> m_externalSVGReferences; 79 79 80 LayoutRect m_targetBoundingBox; 81 FloatRect m_filterRegion; 80 82 RefPtr<ImageBuffer> m_sourceImage; 81 83 RefPtr<CSSFilter> m_filter; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
r286538 r286546 130 130 // Create the SVGFilter object. 131 131 filterData->builder = makeUnique<SVGFilterBuilder>(); 132 filterData->filter = SVGFilter::create(filterElement(), *filterData->builder, renderingMode, filterScale, filterData-> drawingRegion, filterData->boundaries, targetBoundingBox);132 filterData->filter = SVGFilter::create(filterElement(), *filterData->builder, renderingMode, filterScale, filterData->boundaries, targetBoundingBox); 133 133 if (!filterData->filter) { 134 134 m_rendererFilterDataMap.remove(&renderer); -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r286392 r286546 432 432 FloatSize dummyScale(1, 1); 433 433 SVGFilterBuilder builder; 434 auto dummyFilter = SVGFilter::create(filter.filterElement(), builder, RenderingMode::Unaccelerated, dummyScale, dummyRect, dummyRect , dummyRect);434 auto dummyFilter = SVGFilter::create(filter.filterElement(), builder, RenderingMode::Unaccelerated, dummyScale, dummyRect, dummyRect); 435 435 if (dummyFilter) { 436 436 TextStream::IndentScope indentScope(ts); -
trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp
r286466 r286546 30 30 namespace WebCore { 31 31 32 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation clipOperation, FilterEffect& previousEffect)32 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, const FloatRect& targetBoundingBox, FilterEffect& previousEffect) 33 33 { 34 return create(filterElement, builder, renderingMode, filterScale, sourceImageRect, filterRegion, clipOperation, filterRegion, &previousEffect);34 return create(filterElement, builder, renderingMode, filterScale, clipOperation, targetBoundingBox, targetBoundingBox, &previousEffect); 35 35 } 36 36 37 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect&filterRegion, const FloatRect& targetBoundingBox)37 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& filterRegion, const FloatRect& targetBoundingBox) 38 38 { 39 return create(filterElement, builder, renderingMode, filterScale, sourceImageRect, filterRegion, ClipOperation::Intersect, targetBoundingBox, nullptr);39 return create(filterElement, builder, renderingMode, filterScale, ClipOperation::Intersect, filterRegion, targetBoundingBox, nullptr); 40 40 } 41 41 42 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation clipOperation, const FloatRect& targetBoundingBox, FilterEffect* previousEffect)42 RefPtr<SVGFilter> SVGFilter::create(SVGFilterElement& filterElement, SVGFilterBuilder& builder, RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, const FloatRect& filterRegion, const FloatRect& targetBoundingBox, FilterEffect* previousEffect) 43 43 { 44 auto filter = adoptRef(*new SVGFilter(renderingMode, filterScale, sourceImageRect, filterRegion, clipOperation, targetBoundingBox, filterElement.primitiveUnits()));44 auto filter = adoptRef(*new SVGFilter(renderingMode, filterScale, clipOperation, filterRegion, targetBoundingBox, filterElement.primitiveUnits())); 45 45 46 46 if (!previousEffect) … … 72 72 } 73 73 74 SVGFilter::SVGFilter(RenderingMode renderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation clipOperation, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits)75 : Filter(Filter::Type::SVGFilter, renderingMode, filterScale, sourceImageRect, filterRegion, clipOperation)74 SVGFilter::SVGFilter(RenderingMode renderingMode, const FloatSize& filterScale, ClipOperation clipOperation, const FloatRect& filterRegion, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits) 75 : Filter(Filter::Type::SVGFilter, renderingMode, filterScale, clipOperation, filterRegion) 76 76 , m_targetBoundingBox(targetBoundingBox) 77 77 , m_primitiveUnits(primitiveUnits) -
trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h
r286526 r286546 37 37 class SVGFilter final : public Filter { 38 38 public: 39 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation, FilterEffect& previousEffect);40 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect&filterRegion, const FloatRect& targetBoundingBox);41 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation, const FloatRect& targetBoundingBox, FilterEffect* previousEffect);39 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& targetBoundingBox, FilterEffect& previousEffect); 40 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, const FloatRect& filterRegion, const FloatRect& targetBoundingBox); 41 static RefPtr<SVGFilter> create(SVGFilterElement&, SVGFilterBuilder&, RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& filterRegion, const FloatRect& targetBoundingBox, FilterEffect* previousEffect); 42 42 43 43 FloatRect targetBoundingBox() const { return m_targetBoundingBox; } … … 48 48 49 49 private: 50 SVGFilter(RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits);50 SVGFilter(RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& filterRegion, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits); 51 51 52 52 // FIXME: Merge the effectBoundaries in the expression node.
Note:
See TracChangeset
for help on using the changeset viewer.