summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-06-15 08:43:37 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2012-06-15 09:25:53 +0800
commit996194140ce10b8c8b2b1cf8774c857fed4a6f24 (patch)
tree2dadda66bd8582610ecf9780562ee263990075fa
parent0604eb4aadf0162e7971b2e8b138174e376eb5e4 (diff)
copyarea: Cleanup the error handling logic.
Should use ok rather than mixed ok or ret. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/glamor_copyarea.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/glamor_copyarea.c b/src/glamor_copyarea.c
index bfd957a..243c1f2 100644
--- a/src/glamor_copyarea.c
+++ b/src/glamor_copyarea.c
@@ -398,8 +398,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
RegionRec region;
ScreenPtr screen;
int src_x_off, src_y_off, dst_x_off, dst_y_off;
- Bool ret = FALSE;
- int ok = TRUE;
+ Bool ok = TRUE;
int force_clip = 0;
if (nbox == 0)
@@ -423,10 +422,11 @@ _glamor_copy_n_to_n(DrawablePtr src,
if (gc) {
if (!glamor_set_planemask(dst_pixmap, gc->planemask))
- goto fail;
+ goto fall_back;
dispatch = glamor_get_dispatch(glamor_priv);
if (!glamor_set_alu(dispatch, gc->alu)) {
glamor_put_dispatch(glamor_priv);
+ ok = FALSE;
goto fail;
}
glamor_put_dispatch(glamor_priv);
@@ -499,8 +499,10 @@ _glamor_copy_n_to_n(DrawablePtr src,
* it. It's a little hacky, but avoid extra copy. */
temp_source_pixmap = glamor_create_pixmap(src->pScreen, 0, 0,
src->depth, 0);
- if (!temp_source_pixmap)
+ if (!temp_source_pixmap) {
+ ok = FALSE;
goto fail;
+ }
src->pScreen->ModifyPixmapHeader(temp_source_pixmap,
src_pixmap->drawable.width,
src_pixmap->drawable.height,
@@ -619,12 +621,12 @@ fall_back:
}
glamor_finish_access(dst, GLAMOR_ACCESS_RW);
}
- ret = TRUE;
+ ok = TRUE;
done:
glamor_clear_delayed_fallbacks(src->pScreen);
glamor_clear_delayed_fallbacks(dst->pScreen);
- return ret;
+ return ok;
}
RegionPtr