summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-10-15 16:06:59 -0700
committerKenneth Graunke <[email protected]>2013-10-17 14:27:03 -0700
commit5f76bc37abe39bad8ad99a51864f8beda0f6d3d7 (patch)
tree4261b921a262b972eb98780462b030ab0d7c9e6b /src
parent80a9c42e9e9012bf0b4c143f1b8dd325c8c88120 (diff)
i965: Unindent the body of intelDestroyContext.
Having almost the entire body of the function indented one level for a check that should never happen seems silly. Just early return. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index ec3a750e87f..a5ba3533bd4 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -683,39 +683,40 @@ intelDestroyContext(__DRIcontext * driContextPriv)
struct gl_context *ctx = &brw->ctx;
assert(brw); /* should never be null */
- if (brw) {
- /* Dump a final BMP in case the application doesn't call SwapBuffers */
- if (INTEL_DEBUG & DEBUG_AUB) {
- intel_batchbuffer_flush(brw);
- aub_dump_bmp(&brw->ctx);
- }
+ if (!brw)
+ return;
- _mesa_meta_free(&brw->ctx);
+ /* Dump a final BMP in case the application doesn't call SwapBuffers */
+ if (INTEL_DEBUG & DEBUG_AUB) {
+ intel_batchbuffer_flush(brw);
+ aub_dump_bmp(&brw->ctx);
+ }
- brw->vtbl.destroy(brw);
+ _mesa_meta_free(&brw->ctx);
- if (ctx->swrast_context) {
- _swsetup_DestroyContext(&brw->ctx);
- _tnl_DestroyContext(&brw->ctx);
- }
- _vbo_DestroyContext(&brw->ctx);
+ brw->vtbl.destroy(brw);
- if (ctx->swrast_context)
- _swrast_DestroyContext(&brw->ctx);
+ if (ctx->swrast_context) {
+ _swsetup_DestroyContext(&brw->ctx);
+ _tnl_DestroyContext(&brw->ctx);
+ }
+ _vbo_DestroyContext(&brw->ctx);
- intel_batchbuffer_free(brw);
+ if (ctx->swrast_context)
+ _swrast_DestroyContext(&brw->ctx);
- drm_intel_bo_unreference(brw->first_post_swapbuffers_batch);
- brw->first_post_swapbuffers_batch = NULL;
+ intel_batchbuffer_free(brw);
- driDestroyOptionCache(&brw->optionCache);
+ drm_intel_bo_unreference(brw->first_post_swapbuffers_batch);
+ brw->first_post_swapbuffers_batch = NULL;
- /* free the Mesa context */
- _mesa_free_context_data(&brw->ctx);
+ driDestroyOptionCache(&brw->optionCache);
- ralloc_free(brw);
- driContextPriv->driverPrivate = NULL;
- }
+ /* free the Mesa context */
+ _mesa_free_context_data(&brw->ctx);
+
+ ralloc_free(brw);
+ driContextPriv->driverPrivate = NULL;
}
GLboolean