On Thu, 10 Jun 2010 15:37:40 -0700, Jamey Sharp <[email protected]> wrote: > A window's DrawableRec's x and y fields contain the offsets to be > applied to protocol-visible window-relative coordinates in order to make > those coordinates screen-relative instead. When Xinerama is active, > coordinates relative to the root window need to be adjusted for each > screen by the position of that screen in the logical root coordinate > space, so (-pScreen->x) and (-pScreen->y) are the natural values for > the root drawable's x and y offsets. > > Other windows still have root-relative drawable coordinates, as if the > root window's coordinates were (0,0). See CreateWindow. > > This eliminates special cases throughout the Xinerama layer that needed > to adjust coordinates as specified by clients if they were used relative > to a root window. > > Signed-off-by: Jamey Sharp <[email protected]> > --- > I'm not proposing this for 1.9--in fact I've only compile-tested it and > it's probably wrong somehow. But I'd like to get feedback on whether a > patch like this one is a good idea and what it breaks.
As you might imagine, there are a million corner cases with tile origins that could be broken here. Certainly the basic idea of making drawable.x/drawable.y correct for tiling has a lot of merit. Fortunately, the test suite should be able to catch errors of that nature, so making sure that works would be a good first step. > If this approach is good, I have or can write patches to move ValidateGC > and DestroyGC from GCFuncs to ScreenRec, and eliminate the other five > GCFuncs. The patches I have along those lines so far kill 730 lines of > code, on top of the 800 removed here, and promise more to come. One of the benefits of having the GC funcs in a shared structure is that you can unwrap all of the ops and funcs with two pointer exchanges, which makes calling down to the next layer fairly inexpensive. Instead of pulling more funcs into the screen rec, I'd love to see a more formal render layering architecture that moved all of the rendering functions into a single exposed structure that could be unwrapped and re-wrapped easily. Merging the GCops, GC funcs and render funcs together. Then there are a few functions, like CloseScreen, which need to be replaced with a callback instead of wrapping. It would be cool if we identified two classes of functions, wrapped drawing functions and callback state change functions. No, I don't know if this would work either :-) -- [email protected]
pgpidH6nimtq7.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
