[gtk-devel] Depth checking




I was thinking of adding a feature to the gdk kit to enforce the
X restriction that the depth of a GC must match the Drawable 
from which it is being used.  To do this, a depth cache will
be added to the GdkWindowPrivate and GdkGCPrivate.  (This also
saves a trip to the server in a number of places in the gdk API.
Currently to get the depth you must request the visual from
from the server and then check its depth.)  Since the depth is
invarient over the life of the window this a good candidate 
for caching.

To all of the window/pixmap creates the depth field is filled
out directly.  (All the info was there already, it was just being tossed.)
The depth is then check prior to calling the XDraw* command.
In addition, this allows a gdk_gc_dup command to be added which
allows a gc to be duplicated without the need of a drawable.  (Which
is necessary for some OO bindings where the gc needs to be cloned on
passing without extra information.)  

I have completed the modifications in a test gdk version.
It compiles and runs without any noticable problems. 
Is there any problems or issues with these changes?  It there
any reason not to submit a patch for it?

--Karl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]