diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_screen.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 8 |
7 files changed, 37 insertions, 41 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 7e17e95ee4c..cba5434b5e1 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -875,12 +875,11 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, /* setup the hardware-based renderbuffers */ rb = intel_create_renderbuffer(rgbFormat); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); if (mesaVis->doubleBufferMode) { rb = intel_create_renderbuffer(rgbFormat); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT, - &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_BACK_LEFT, &rb->Base.Base); } /* @@ -896,13 +895,13 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, * attached to two attachment points. */ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_attach_and_reference_rb(fb, BUFFER_STENCIL, &rb->Base.Base); } else if (mesaVis->depthBits == 16) { assert(mesaVis->stencilBits == 0); rb = intel_create_private_renderbuffer(MESA_FORMAT_Z_UNORM16); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base); } else { assert(mesaVis->depthBits == 0); diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 39e463d264d..34a5f18af23 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1162,11 +1162,11 @@ intelCreateBuffer(__DRIscreen *dri_screen, /* setup the hardware-based renderbuffers */ rb = intel_create_renderbuffer(rgbFormat, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); if (mesaVis->doubleBufferMode) { rb = intel_create_renderbuffer(rgbFormat, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_BACK_LEFT, &rb->Base.Base); } /* @@ -1180,11 +1180,10 @@ intelCreateBuffer(__DRIscreen *dri_screen, if (screen->devinfo.has_hiz_and_separate_stencil) { rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base); rb = intel_create_private_renderbuffer(MESA_FORMAT_S_UINT8, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_STENCIL, - &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_STENCIL, &rb->Base.Base); } else { /* * Use combined depth/stencil. Note that the renderbuffer is @@ -1192,15 +1191,15 @@ intelCreateBuffer(__DRIscreen *dri_screen, */ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_attach_and_reference_rb(fb, BUFFER_STENCIL, &rb->Base.Base); } } else if (mesaVis->depthBits == 16) { assert(mesaVis->stencilBits == 0); rb = intel_create_private_renderbuffer(MESA_FORMAT_Z_UNORM16, num_samples); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base); } else { assert(mesaVis->depthBits == 0); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index 2dbd9d13b67..375f640f3d0 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -259,27 +259,27 @@ nouveau_create_buffer(__DRIscreen *dri_screen, /* Front buffer. */ rb = nouveau_renderbuffer_dri_new(color_format, drawable); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT, rb); + _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, rb); /* Back buffer */ if (visual->doubleBufferMode) { rb = nouveau_renderbuffer_dri_new(color_format, drawable); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT, rb); + _mesa_attach_and_own_rb(fb, BUFFER_BACK_LEFT, rb); } /* Depth/stencil buffer. */ if (visual->depthBits == 24 && visual->stencilBits == 8) { rb = nouveau_renderbuffer_dri_new(GL_DEPTH24_STENCIL8_EXT, drawable); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, rb); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, rb); + _mesa_attach_and_reference_rb(fb, BUFFER_STENCIL, rb); } else if (visual->depthBits == 24) { rb = nouveau_renderbuffer_dri_new(GL_DEPTH_COMPONENT24, drawable); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, rb); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, rb); } else if (visual->depthBits == 16) { rb = nouveau_renderbuffer_dri_new(GL_DEPTH_COMPONENT16, drawable); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, rb); + _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, rb); } /* Software renderbuffers. */ diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index fab2eeab6c9..79e388988a0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -677,13 +677,13 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv, /* front color renderbuffer */ rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv); - _mesa_add_renderbuffer_without_ref(&rfb->base, BUFFER_FRONT_LEFT, &rfb->color_rb[0]->base.Base); + _mesa_attach_and_own_rb(&rfb->base, BUFFER_FRONT_LEFT, &rfb->color_rb[0]->base.Base); rfb->color_rb[0]->has_surface = 1; /* back color renderbuffer */ if (mesaVis->doubleBufferMode) { rfb->color_rb[1] = radeon_create_renderbuffer(rgbFormat, driDrawPriv); - _mesa_add_renderbuffer_without_ref(&rfb->base, BUFFER_BACK_LEFT, &rfb->color_rb[1]->base.Base); + _mesa_attach_and_own_rb(&rfb->base, BUFFER_BACK_LEFT, &rfb->color_rb[1]->base.Base); rfb->color_rb[1]->has_surface = 1; } @@ -691,21 +691,21 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv, if (mesaVis->stencilBits == 8) { struct radeon_renderbuffer *depthStencilRb = radeon_create_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT, driDrawPriv); - _mesa_add_renderbuffer_without_ref(&rfb->base, BUFFER_DEPTH, &depthStencilRb->base.Base); - _mesa_add_renderbuffer(&rfb->base, BUFFER_STENCIL, &depthStencilRb->base.Base); + _mesa_attach_and_own_rb(&rfb->base, BUFFER_DEPTH, &depthStencilRb->base.Base); + _mesa_attach_and_reference_rb(&rfb->base, BUFFER_STENCIL, &depthStencilRb->base.Base); depthStencilRb->has_surface = screen->depthHasSurface; } else { /* depth renderbuffer */ struct radeon_renderbuffer *depth = radeon_create_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT, driDrawPriv); - _mesa_add_renderbuffer_without_ref(&rfb->base, BUFFER_DEPTH, &depth->base.Base); + _mesa_attach_and_own_rb(&rfb->base, BUFFER_DEPTH, &depth->base.Base); depth->has_surface = screen->depthHasSurface; } } else if (mesaVis->depthBits == 16) { /* just 16-bit depth buffer, no hw stencil */ struct radeon_renderbuffer *depth = radeon_create_renderbuffer(MESA_FORMAT_Z_UNORM16, driDrawPriv); - _mesa_add_renderbuffer_without_ref(&rfb->base, BUFFER_DEPTH, &depth->base.Base); + _mesa_attach_and_own_rb(&rfb->base, BUFFER_DEPTH, &depth->base.Base); depth->has_surface = screen->depthHasSurface; } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index f43ac608cf2..de1fe4c918c 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -569,14 +569,12 @@ dri_create_buffer(__DRIscreen * sPriv, /* add front renderbuffer */ frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT, - &frontrb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, &frontrb->Base.Base); /* add back renderbuffer */ if (visual->doubleBufferMode) { backrb = swrast_new_renderbuffer(visual, dPriv, GL_FALSE); - _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT, - &backrb->Base.Base); + _mesa_attach_and_own_rb(fb, BUFFER_BACK_LEFT, &backrb->Base.Base); } /* add software renderbuffers */ diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 68fca3e6326..a3d4facdea0 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1020,15 +1020,15 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, * There is no back color buffer. * If the user tries to use a 8, 16 or 32-bit/channel buffer that * doesn't match what Mesa was compiled for (CHAN_BITS) the - * _mesa_add_renderbuffer() function will create a "wrapper" renderbuffer - * that converts rendering from CHAN_BITS to the user-requested channel - * size. + * _mesa_attach_and_reference_rb() function will create a "wrapper" + * renderbuffer that converts rendering from CHAN_BITS to the + * user-requested channel size. */ if (!osmesa->srb) { osmesa->srb = new_osmesa_renderbuffer(&osmesa->mesa, osmesa->format, type); _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT); - _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, - &osmesa->srb->Base); + _mesa_attach_and_reference_rb(osmesa->gl_buffer, BUFFER_FRONT_LEFT, + &osmesa->srb->Base); assert(osmesa->srb->Base.RefCount == 2); } @@ -1051,8 +1051,8 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, * renderbuffer adaptor/wrapper if needed (for bpp conversion). */ _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT); - _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, - &osmesa->srb->Base); + _mesa_attach_and_reference_rb(osmesa->gl_buffer, BUFFER_FRONT_LEFT, + &osmesa->srb->Base); /* this updates the visual's red/green/blue/alphaBits fields */ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 5be8aa95de1..b54900b2aeb 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -311,8 +311,8 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->frontxrb->Parent = b; b->frontxrb->drawable = d; b->frontxrb->pixmap = (XMesaPixmap) d; - _mesa_add_renderbuffer_without_ref(&b->mesa_buffer, BUFFER_FRONT_LEFT, - &b->frontxrb->Base.Base); + _mesa_attach_and_own_rb(&b->mesa_buffer, BUFFER_FRONT_LEFT, + &b->frontxrb->Base.Base); /* * Back renderbuffer @@ -328,8 +328,8 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, /* determine back buffer implementation */ b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; - _mesa_add_renderbuffer_without_ref(&b->mesa_buffer, BUFFER_BACK_LEFT, - &b->backxrb->Base.Base); + _mesa_attach_and_own_rb(&b->mesa_buffer, BUFFER_BACK_LEFT, + &b->backxrb->Base.Base); } /* |