mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-09 05:30:35 +01:00
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.
This commit is contained in:
parent
2d5ea175f7
commit
180b41594c
3 changed files with 23 additions and 27 deletions
|
|
@ -363,7 +363,7 @@ __driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
|
|||
memcpy(pdp->pClipRects, last_dc->rects, rect_size);
|
||||
|
||||
if (changed)
|
||||
(*psp->DriverAPI.UpdateBuffer)(pdp, (unsigned int *) last_dc);
|
||||
(*psp->DriverAPI.HandleDrawableConfig)(pdp, pcp, last_dc);
|
||||
}
|
||||
|
||||
/* Front buffer attachments are special, they typically mean that
|
||||
|
|
@ -380,12 +380,12 @@ __driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
|
|||
* We only care about the last such event in the buffer; in fact,
|
||||
* older events will refer to invalid buffer objects.*/
|
||||
if (last_ba)
|
||||
(*psp->DriverAPI.UpdateBuffer)(pdp, (unsigned int *) last_ba);
|
||||
(*psp->DriverAPI.HandleBufferAttach)(pdp, pcp, last_ba);
|
||||
|
||||
/* Like for buffer attachments, we only care about the most recent
|
||||
* drawable config. */
|
||||
if (last_dc)
|
||||
(*psp->DriverAPI.UpdateBuffer)(pdp, (unsigned int *) last_dc);
|
||||
(*psp->DriverAPI.HandleDrawableConfig)(pdp, pcp, last_dc);
|
||||
|
||||
/* If there was a drawable config event in the buffer and it
|
||||
* changed the size of the window, all buffer auxillary buffer
|
||||
|
|
@ -411,7 +411,7 @@ __driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
|
|||
if (last_ba == ba)
|
||||
continue;
|
||||
|
||||
(*psp->DriverAPI.UpdateBuffer)(pdp, (unsigned int *) ba);
|
||||
(*psp->DriverAPI.HandleBufferAttach)(pdp, pcp, ba);
|
||||
}
|
||||
|
||||
pdp->dri2.tail = tail;
|
||||
|
|
|
|||
|
|
@ -209,8 +209,14 @@ struct __DriverAPIRec {
|
|||
int64_t *count);
|
||||
|
||||
/* DRI2 Entry points */
|
||||
void (*UpdateBuffer)(__DRIdrawablePrivate *dPriv,
|
||||
unsigned int *event);
|
||||
void (*HandleDrawableConfig)(__DRIdrawablePrivate *dPriv,
|
||||
__DRIcontextPrivate *pcp,
|
||||
__DRIDrawableConfigEvent *event);
|
||||
|
||||
void (*HandleBufferAttach)(__DRIdrawablePrivate *dPriv,
|
||||
__DRIcontextPrivate *pcp,
|
||||
__DRIBufferAttachEvent *ba);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue