From e9d2156edfba222d6aa56d94c041fc2017c240fd Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 3 Nov 2007 10:19:38 -0600 Subject: [PATCH] Remove intelUpdateFramebufferSize(), use st_resize_framebuffer(). --- .../drivers/dri/intel_winsys/intel_context.c | 38 +++++-------------- .../drivers/dri/intel_winsys/intel_context.h | 3 -- .../dri/intel_winsys/intel_swapbuffers.c | 9 +++-- 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index 721f73bcd96..8cc285276ae 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -169,7 +169,6 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) { struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate; - GLcontext *ctx = intel->st->ctx; assert(intel); /* should never be null */ if (intel) { @@ -203,55 +202,36 @@ intelUnbindContext(__DRIcontextPrivate * driContextPriv) } -/** - * Copied/modified from drirenderbuffer.c - */ -void -intelUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv) -{ - struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate; - if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) { - _mesa_resize_framebuffer(ctx, fb, dPriv->w, dPriv->h); - /* if the driver needs the hw lock for ResizeBuffers, the drawable - might have changed again by now */ - assert(fb->Width == dPriv->w); - assert(fb->Height == dPriv->h); - } -} - - GLboolean intelMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driDrawPriv, __DRIdrawablePrivate * driReadPriv) { if (driContextPriv) { - struct intel_context *intel = - (struct intel_context *) driContextPriv->driverPrivate; + struct intel_context *intel + = (struct intel_context *) driContextPriv->driverPrivate; struct st_framebuffer *draw_fb = (struct st_framebuffer *) driDrawPriv->driverPrivate; struct st_framebuffer *read_fb = (struct st_framebuffer *) driReadPriv->driverPrivate; - GLcontext *ctx = intel->st->ctx; /* this is a hack so we have a valid context when the region allocation is done. Need a per-screen context? */ intel->intelScreen->dummyctxptr = intel; - /* update GLframebuffer size to match window if needed */ - intelUpdateFramebufferSize(ctx, driDrawPriv); + st_make_current(intel->st, draw_fb, read_fb); + /* update size of Mesa framebuffer(s) to match window */ + st_resize_framebuffer(draw_fb, driDrawPriv->w, driDrawPriv->h); if (driReadPriv != driDrawPriv) { - intelUpdateFramebufferSize(ctx, driReadPriv); + st_resize_framebuffer(read_fb, driReadPriv->w, driReadPriv->h); } - st_make_current(intel->st, draw_fb, read_fb); - if ((intel->driDrawable != driDrawPriv) || (intel->lastStamp != driDrawPriv->lastStamp)) { - intel->driDrawable = driDrawPriv; - intelWindowMoved(intel); - intel->lastStamp = driDrawPriv->lastStamp; + intel->driDrawable = driDrawPriv; + intelWindowMoved(intel); + intel->lastStamp = driDrawPriv->lastStamp; } } else { diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.h b/src/mesa/drivers/dri/intel_winsys/intel_context.h index efaf22e2f1d..8f3ce026b6e 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.h @@ -140,7 +140,4 @@ intel_context(GLcontext * ctx) } -extern void -intelUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv); - #endif diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c index a80b5a4198a..387e3bc72e6 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c @@ -34,6 +34,7 @@ #include "context.h" #include "pipe/p_context.h" +#include "state_tracker/st_public.h" #include "state_tracker/st_context.h" #include "state_tracker/st_cb_fbo.h" @@ -237,17 +238,17 @@ intelDisplaySurface(__DRIdrawablePrivate * dPriv, /** * This will be called whenever the currently bound window is moved/resized. - * XXX: actually, it seems to NOT be called when the window is only moved (BP). */ void intelWindowMoved(struct intel_context *intel) { - GLcontext *ctx = intel->st->ctx; __DRIdrawablePrivate *dPriv = intel->driDrawable; struct intel_framebuffer *intel_fb = dPriv->driverPrivate; + struct st_framebuffer *stfb + = (struct st_framebuffer *) dPriv->driverPrivate; + + st_resize_framebuffer(stfb, dPriv->w, dPriv->h); - /* Update Mesa's notion of window size */ - intelUpdateFramebufferSize(ctx, dPriv); intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */ } -- 2.30.2