From: Christopher C. <chr...@gm...> - 2021-05-04 22:50:21
|
Sent: Monday, May 03, 2021 at 5:14 PM From: "Marc Culler" <mar...@gm...> > Hi Jan, > I disagree with your change in 9fda84d2, where you remove the first two parameters of TkpPutRGBAImage. The reason that you give is that those parameters are not used on macOS. But that is a bad reason, since those parameters would be used on other platforms, notably X11. > The whole point was to have a function with the exact same signature as TkPutImage. It is meant to replace TkPutImage for platforms which are able to use native code (and hence the graphics card) to do Porter-Duff source-over blending. tkImgPhInstance can do that blending without using the graphics card if necessary, but now it will call TkpPutRGBAImage on platforms that provide it. I had in mind that the function should be exported as a stub, and that is another reason why the signature should be the same for all platforms. While it makes sense to me for TkpPutRGBAImage() to be a replacement for TkPutImage(), I do think it is okay to remove the *colors/ncolors parameters for TkpPutRGBAImage(); I don’t think they would be used on any platform. For TkPutImage(), they are only used on Windows (and only for one call in TkImgDitherInstance()), and actually appear to be unused on X11 (see tkUnixPort.h). I also think it would be reasonable for TkpPutRGBAImage() to only accept non-palette 32-bpp ZPixmaps, and not have to handle anything that TkPutImage() can do. Christopher A. Chavez |