diff options
author | Kristian Høgsberg <[email protected]> | 2008-03-09 21:22:49 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2008-03-09 21:22:49 -0400 |
commit | 180b41594c669574355b54ceb2c2ff96889bf336 (patch) | |
tree | 5e232d9ba43e62f55f8c933ec8ef748ce58c8acb /src/mesa/drivers/dri/intel | |
parent | 2d5ea175f7fcd65de71b7589435b9a908f998d51 (diff) |
DRI2: Drop DriverAPI.UpdateBuffer.
__dri2ParseEvents() would determine the kind of event, but then call
UpdateBuffer() in either case, and UpdateBuffer() would then have to
figure that out again to dispatch to HandleBufferAttach() or
HandleDrawableConfig(). Pretty pointless.
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 1c79cf2cff4..3d46073daad 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -293,14 +293,17 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, static void intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv, + __DRIcontextPrivate *pcp, __DRIDrawableConfigEvent *event) { struct intel_framebuffer *intel_fb = dPriv->driverPrivate; struct intel_region *region = NULL; struct intel_renderbuffer *rb, *depth_rb, *stencil_rb; - struct intel_context *intel = dPriv->driContextPriv->driverPrivate; - int cpp = intel->ctx.Visual.rgbBits / 8; - GLuint pitch = ((cpp * dPriv->w + 63) & ~63) / cpp; + struct intel_context *intel = pcp->driverPrivate; + int cpp, pitch; + + cpp = intel->ctx.Visual.rgbBits / 8; + pitch = ((cpp * dPriv->w + 63) & ~63) / cpp; rb = intel_fb->color_rb[1]; if (rb) { @@ -331,12 +334,13 @@ intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv, static void intelHandleBufferAttach(__DRIdrawablePrivate *dPriv, + __DRIcontextPrivate *pcp, __DRIBufferAttachEvent *ba) { struct intel_framebuffer *intel_fb = dPriv->driverPrivate; struct intel_renderbuffer *rb; struct intel_region *region; - struct intel_context *intel = dPriv->driContextPriv->driverPrivate; + struct intel_context *intel = pcp->driverPrivate; GLuint tiled; switch (ba->buffer.attachment) { @@ -380,22 +384,6 @@ intelHandleBufferAttach(__DRIdrawablePrivate *dPriv, intel_renderbuffer_set_region(rb, region); } -static void -intelUpdateBuffer(__DRIdrawablePrivate *dPriv, unsigned int *event) -{ - switch (DRI2_EVENT_TYPE(*event)) { - case DRI2_EVENT_DRAWABLE_CONFIG: - /* flush all current regions, allocate new ones, except front buffer */ - intelHandleDrawableConfig(dPriv, (__DRIDrawableConfigEvent *) event); - break; - - case DRI2_EVENT_BUFFER_ATTACH: - /* attach buffer if different from what we have */ - intelHandleBufferAttach(dPriv, (__DRIBufferAttachEvent *) event); - break; - } -} - static const __DRItexOffsetExtension intelTexOffsetExtension = { { __DRI_TEX_OFFSET }, intelSetTexOffset, @@ -680,7 +668,9 @@ static const struct __DriverAPIRec intelAPI = { .WaitForSBC = NULL, .SwapBuffersMSC = NULL, .CopySubBuffer = intelCopySubBuffer, - .UpdateBuffer = intelUpdateBuffer, + + .HandleDrawableConfig = intelHandleDrawableConfig, + .HandleBufferAttach = intelHandleBufferAttach, }; |