void
intelDestroyContext(__DRIcontextPrivate * driContextPriv)
{
- struct intel_context *intel =
- (struct intel_context *) driContextPriv->driverPrivate;
+ struct intel_context *intel = intel_context(driContextPriv);
assert(intel); /* should never be null */
if (intel) {
GLboolean
intelUnbindContext(__DRIcontextPrivate * driContextPriv)
{
- struct intel_context *intel
- = (struct intel_context *) driContextPriv->driverPrivate;
+ struct intel_context *intel = intel_context(driContextPriv);
st_flush(intel->st);
return GL_TRUE;
}
__DRIdrawablePrivate * driReadPriv)
{
if (driContextPriv) {
- struct intel_context *intel
- = (struct intel_context *) driContextPriv->driverPrivate;
+ struct intel_context *intel = intel_context(driContextPriv);
struct intel_framebuffer *draw_fb = intel_framebuffer(driDrawPriv);
struct intel_framebuffer *read_fb = intel_framebuffer(driReadPriv);
/** Cast wrapper */
static INLINE struct intel_context *
-intel_context(GLcontext * ctx)
+intel_context_mesa(GLcontext * ctx)
{
return (struct intel_context *) ctx->DriverCtx;
}
+/** Cast wrapper */
+static INLINE struct intel_context *
+intel_context(__DRIcontextPrivate *driContextPriv)
+{
+ return (struct intel_context *) driContextPriv->driverPrivate;
+}
+
+
/** Cast wrapper */
static INLINE struct intel_framebuffer *
intel_framebuffer(__DRIdrawablePrivate * driDrawPriv)
return intelScreen->dummyctxptr;
}
- return intel_context(ctx);
+ return intel_context_mesa(ctx);
}
/* if this drawable isn't currently bound the LOCK_HARDWARE done on the
current context (which is what intelScreenContext should return) might
not get a contended lock and thus cliprects not updated (tests/manywin) */
- if ((struct intel_context *)dPriv->driContextPriv->driverPrivate != intel)
+ if (intel_context(dPriv->driContextPriv) != intel)
DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);
intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
{
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- struct intel_context *intel =
- (struct intel_context *) dPriv->driContextPriv->driverPrivate;
+ struct intel_context *intel = intel_context(dPriv->driContextPriv);
GLcontext *ctx = intel->st->ctx;
if (ctx->Visual.doubleBufferMode) {