On Tue, Mar 1, 2011 at 1:37 PM, Bill Spitzak <[email protected]> wrote: > A Wayland compositor *could* resample the source images knowing about the > positions of the rgb subpixels on the output device. For instance the > filtering could shift the source transform 1/3 pixel right for the red and > 1/3 pixel to the left for the blue, to compensate for where the centers of > these LCDs are. Further (and more complex) filtering will be needed to avoid > color fringing in high-contrast areas.
It would be interesting to figure out how to use the full-screen anti-aliasing hardware available on most graphics cards. But I don't see any way to do that other than by having the app draw the final transformed window including a depth buffer. Getting that to work could provide 16x over sampling. I don't think is is feasible to keep intermediate bitmaps at 16x resolution and then let Wayland filter down, but it may be possible. Graphics cards do have lots of memory and desktops don't use much of it. > > It is also likely that the client wants to render an image to display at 1:1 > scale on a particular subpixel screen (i.e it uses freetype's subpixel > rendering). In this case the filtering also has to try to invert the 1/3 > shifts and color fringing filtering that the client did. Ideally these will > cancel out if the scale is the same and the input and output subpixel > arrangement is the same. > > Each individual monitor may have a different subpixel arrangement (chiefly > due to users wanting one in portrait while another is in landscape). > > Though I think Wayland will ignore all this initially, it should provide an > API so this can be done in the future. Something like this: > > 1. When a client provides an image, it also tells the compositor what > subpixel arrangement it was rendered for (none, horizontal and vertical rgb > or bgr, etc). The compositor can use this information to change how > filtering is done in transforms. > > 2. The compositor informs the client about the arrangement of all the > monitors, and part of this is the subpixel arrangement of each of them. The > client can then render images with the correct subpixel for the monitor. It > can assume that if the scale is 1:1 and the subpixels match, that the > compositor will put those pixels unchanged on the monitor. > > 3. To allow "perfect" output when a window spans monitors with different > subpixel arrangements, I think the easiest way would be for clients to be > able to restrict an image to particular monitors. The client could then > provide two source images, each drawn for a given monitor and restricted to > it, and each with the same transform. The user would see the window spanning > the two monitors, but as they moved the window, if they look really closely, > would see the antialiasing switch between them. > > _______________________________________________ > wayland-devel mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > -- Jon Smirl [email protected] _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
