Eric Anholt <[email protected]> writes:
> +struct glamor_context {
> + /** Either an EGLDisplay or an Xlib Display */
> + void *display;
> +
> + /** Either a GLXContext or an EGLContext. */
> + void *ctx;
> +
> + /** The EGLSurface we should MakeCurrent to */
> + void *drawable;
> +
> + /** The GLXDrawable we should MakeCurrent to */
> + uint32_t drawable_xid;
Hrm. I don't see any code outside of the egl/glx bits which use display,
drawable or drawable_xid. I think you could use per-backend structures
that embed the glamor_context within them like this:
struct glamor_context {
void *ctx
void (*get_context)(struct glamor_context *glamor_ctx);
void (*put_context)(struct glamor_context *glamor_ctx);
};
struct glamor_context_egl {
struct glamor_context base;
EGLDisplay display;
};
struct glamor_context_glx {
struct glamor_context base;
Display *display;
GLXDrawable drawable_xid;
};
It would mean that the backend would be allocating this, but that would
also give it a spot for it's own screen private data; right now, you've
got two screen privates, one for glamor and one for glamor_egl.
Just suggestions, the code looks fine as it is.
Reviewed-by: Keith Packard <[email protected]>
--
[email protected]
pgpp56ldAPt9L.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
