intel: Rely on intel_region_reference()'s support of *dst != NULL.
authorEric Anholt <eric@anholt.net>
Wed, 29 Jun 2011 18:14:23 +0000 (11:14 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 7 Jul 2011 21:05:20 +0000 (14:05 -0700)
Reviewed-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/i915/i830_vtbl.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_screen.c

index 584df82b50c8c8c01335c2b4a7f7371a6e5becf2..7775e71381f01742f6cbc064d4c5d37574ee74f7 100644 (file)
@@ -618,11 +618,9 @@ i830_set_draw_region(struct intel_context *intel,
    uint32_t draw_x, draw_y;
 
    if (state->draw_region != color_regions[0]) {
-      intel_region_release(&state->draw_region);
       intel_region_reference(&state->draw_region, color_regions[0]);
    }
    if (state->depth_region != depth_region) {
-      intel_region_release(&state->depth_region);
       intel_region_reference(&state->depth_region, depth_region);
    }
 
index 9721a1c0e4d2b6dc49f1e63af98434c1599b6ae4..cd7d108222ee6a9a09841191475cd4386eae9d3e 100644 (file)
@@ -570,11 +570,9 @@ i915_set_draw_region(struct intel_context *intel,
    uint32_t draw_x, draw_y, draw_offset;
 
    if (state->draw_region != color_regions[0]) {
-      intel_region_release(&state->draw_region);
       intel_region_reference(&state->draw_region, color_regions[0]);
    }
    if (state->depth_region != depth_region) {
-      intel_region_release(&state->depth_region);
       intel_region_reference(&state->depth_region, depth_region);
    }
 
index 90c3909d1d85330ed20e47563317af23b8516f2e..ee656edae5b84246145933cd60fae861c104253b 100644 (file)
@@ -277,8 +277,6 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
       return;
 
    irb = intel_renderbuffer(rb);
-   if (irb->region)
-      intel_region_release(&irb->region);
    intel_region_reference(&irb->region, image->region);
 
    rb->InternalFormat = image->internal_format;
@@ -351,12 +349,7 @@ intel_renderbuffer_set_region(struct intel_context *intel,
                              struct intel_renderbuffer *rb,
                              struct intel_region *region)
 {
-   struct intel_region *old;
-
-   old = rb->region;
-   rb->region = NULL;
    intel_region_reference(&rb->region, region);
-   intel_region_release(&old);
 }
 
 
@@ -365,10 +358,7 @@ intel_renderbuffer_set_hiz_region(struct intel_context *intel,
                                  struct intel_renderbuffer *rb,
                                  struct intel_region *region)
 {
-   struct intel_region *old = rb->hiz_region;
-   rb->hiz_region = NULL;
    intel_region_reference(&rb->hiz_region, region);
-   intel_region_release(&old);
 }
 
 
@@ -572,7 +562,6 @@ intel_update_tex_wrapper_regions(struct intel_context *intel,
 
    /* Point the renderbuffer's region to the texture's region. */
    if (irb->region != intel_image->mt->region) {
-      intel_region_release(&irb->region);
       intel_region_reference(&irb->region, intel_image->mt->region);
    }
 
@@ -592,7 +581,6 @@ intel_update_tex_wrapper_regions(struct intel_context *intel,
 
    /* Point the renderbuffer's hiz region to the texture's hiz region. */
    if (irb->hiz_region != intel_image->mt->hiz_region) {
-      intel_region_release(&irb->hiz_region);
       intel_region_reference(&irb->hiz_region, intel_image->mt->hiz_region);
    }
 
@@ -770,7 +758,6 @@ intel_render_texture(struct gl_context * ctx,
       intel_image->mt = new_mt;
       intel_renderbuffer_set_draw_offset(irb, intel_image, att->Zoffset);
 
-      intel_region_release(&irb->region);
       intel_region_reference(&irb->region, intel_image->mt->region);
    }
 #endif
index 2a3a601ddbad721bdd5631f4a3179ab10cc00818..bd8d574a29e936493b8e7002d9dad0e505bc2a98 100644 (file)
@@ -291,7 +291,6 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
    if (image == NULL)
       return NULL;
 
-   image->region = NULL;
    intel_region_reference(&image->region, orig_image->region);
    if (image->region == NULL) {
       FREE(image);