FilterEffect should be able to calculate and hold only two rectangles: 1) primitiveSubRegion which is defined here https://www.w3.org/TR/filter-effects-1/#FilterPrimitiveSubRegion 2) imageRect which is the rectangle of the result FilterImage. And to simplify the calculation we can keep these two rectangles as FloatRects and they will be in filter coordinates. But 1) Only when drawing to a FilterImage, we should convert from filter coordinates to absolute coordinates. 2) And when getting pixels from or putting pixels in a FilterImage, we will convert the FloatRect to a IntRect. And since the plan is to remove the result FilterImage from the FilterEffect, we are going to keep these rectangles in FilterImage. The conversion from filter coordinates to absolute coordinates will happen through the Filter class.
Created attachment 443290 [details] Patch
Created attachment 443503 [details] Patch
Created attachment 443504 [details] Patch
Created attachment 443505 [details] Patch
Created attachment 443516 [details] Patch
Created attachment 443517 [details] Patch
Created attachment 443652 [details] Patch for review
<rdar://problem/85290142>
Created attachment 445965 [details] Patch
Created attachment 446055 [details] Patch
Created attachment 446057 [details] Patch
Created attachment 446074 [details] Patch
Comment on attachment 446074 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446074&action=review > Source/WebCore/platform/graphics/filters/FilterEffect.cpp:52 > + for (auto& input : inputs) > + primitiveSubregion.unite(input->primitiveSubregion()); I guess we're guaranteed that input's primitive subregion has already been calculated at this point, because of the ordering of the filter effects in the overall expression?
Comment on attachment 446074 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446074&action=review >> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:52 >> + primitiveSubregion.unite(input->primitiveSubregion()); > > I guess we're guaranteed that input's primitive subregion has already been calculated at this point, because of the ordering of the filter effects in the overall expression? Yes this correct. In SVGFilter we apply the effects from the SVGFilterExpression which is the post-fix notation of the filter. For CSSFilter we apply the effects from left to right since every effect is the input to the next effect.
Committed r286578 (?): <https://commits.webkit.org/r286578> All reviewed patches have been landed. Closing bug and clearing flags on attachment 446074 [details].