Closed flackr closed 4 months ago
Thanks for filing! For some parts of the current Firefox implementation (specifically Canvas2D filters on Windows) it would be convenient if the reflection worked the same as in D2D1_BORDER_EDGE_MODE_MIRROR
.
I don't know anything about the impl concerns of this, but is there a particular reason we're reflecting solely on the right/bottom edges? Or was this just an artifact of a simplified example, and a "real" reflect would also have reflected pixels along the top/left edges?
It would of course be mirrored / reflected on all edges, I was just following the conventions at https://drafts.fxtf.org/filter-effects-1/#element-attrdef-feconvolvematrix-edgemode where they've only illustrated extending further down and to the right even though the existing edge modes also can extend up and to the left.
Thanks for filing! For some parts of the current Firefox implementation (specifically Canvas2D filters on Windows) it would be convenient if the reflection worked the same as in
D2D1_BORDER_EDGE_MODE_MIRROR
.
I'm not sure where it is defined, but looking at https://learn.microsoft.com/en-us/windows/win32/direct2d/border#mirror it does look like the mirroring is equivalent to the proposal here - repeating the border pixels - such that you can draw an image 2x the original size and have exactly one mirrored copy.
The CSS Working Group just discussed [filter-effects-1] Add edgemode=reflect
, and agreed to the following:
RESOLVED: add mirror value to edgemode attribute
A reflect edgemode in filter-effects-1 would be very useful as the behavior for the backdrop-filter blur behavior (See #374) as it avoids a discontinuity when moving the filter over new content.
The behavior of this mode would be that pixels outside mirror the pixels inside, e.g. it would be as follows: Original N-by-M image, where m=M-1 and n=N-1:
Extended by two pixels in each direction using reflect:
We can debate whether the border pixels should repeat in reflect mode, but doing so has the nice property that a 2N by 2M sampling is exactly one additional copy of the image worth of pixels.