diff options
author | Dave Airlie <airlied@redhat.com> | 2011-03-09 14:53:26 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-03-10 11:00:48 +1000 |
commit | 5a94934487ea477947e24dcd4720b7cde77d3d2f (patch) | |
tree | ebf3bd55094670139ebf2dbf0ef4129ab361a05b /render | |
parent | c48c530e541e201ea1afe2512d85967659ceef84 (diff) |
panoramiX: consolidate common id assignment code.
This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first
element and is a common idiom throughout panoramiX code.
It then adds a new inline function to hide id assignment to a
panoramiX resource and cleans up lots of common repeated code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'render')
-rw-r--r-- | render/render.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/render/render.c b/render/render.c index 702955818..3cb1b54bb 100644 --- a/render/render.c +++ b/render/render.c @@ -2690,7 +2690,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); if (refDraw->type == XRT_WINDOW && stuff->drawable == screenInfo.screens[0]->root->drawable.id) @@ -2699,9 +2699,6 @@ PanoramiXRenderCreatePicture (ClientPtr client) } else newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; @@ -3225,11 +3222,8 @@ PanoramiXRenderCreateSolidFill (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; @@ -3258,12 +3252,9 @@ PanoramiXRenderCreateLinearGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client); @@ -3291,12 +3282,9 @@ PanoramiXRenderCreateRadialGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client); @@ -3324,12 +3312,9 @@ PanoramiXRenderCreateConicalGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client); |