On Thu, 12 Sep 2024 13:37:07 GMT, Nir Lisker <nlis...@openjdk.org> wrote:
> I won't be doing a full review, but I want to look at the API in case > something was missed and regret it later :) > > The only other thing I was curious about is how the css specs decides which > interpolation type to use for each type of value, and if we do the same. I > thought that image interpolation is ambiguous: do you just jump to the other > image or do you fade/blend from one to the other? I see that you went with > the former, which is simpler, but the latter is more intuitive for me. One > can use a custom interpolator, but I didn't look if it works with css. Fading between images is really hard, as its implications reach deep into the rendering system. For performance reasons, blending the images shouldn't be done by the CSS system on the CPU; instead, we would need a way to feed both images into the rendering system, such that they can be combined with two render passes. In addition to that, a background or border can layer multiple images on top of each other. In this case, it is unclear whether we would want each image layer to blend separately, or if the stack of images should blend as a whole. This would also require special support in the rendering system. That's probably the reason why smooth interpolation of images is not supported by specifications such as [Backgrounds Level 3](https://drafts.csswg.org/css-backgrounds-3/#propdef-background-image). Support for interpolation of images is coming in [Images Level 4](https://drafts.csswg.org/css-images-4/#interpolating-images), but that has not made its way yet into the work-in-progress [Backgrounds Level 4](https://drafts.csswg.org/css-backgrounds-4/). I'd say we take a slow approach here and wait until the pieces settle down to see where this potential future feature lands. As for the mor general question how we decide which interpolation type we support: the current implementation always tries to support smooth interpolation, except where it would be hard to do so. That's the same approach that the W3C spec uses. I think we can (and should) extend support for smooth interpolation in the future. For example, currently we can't smoothly interpolate between relative and absolute values, but this is a feature that can be added later. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1522#issuecomment-2346429243