summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2010-01-29 19:07:03 -0800
committerKeith Packard <keithp@keithp.com>2010-01-29 21:38:50 -0800
commit4d575b0559817258f7a0ce6c4d2d0f9e7e5bba63 (patch)
tree506983d72eb3027abe937819ef01bb3f5cab8848 /render
parent8d6b1838330625b758ebc55bb0df1b425c5cefaf (diff)
RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanup
If these aren't wrapped, then procs that are wrapped (such as RenderChangePicture) will fail in Xinerama when they see the resource type of a picture created through one of these interfaces is PictureType and not XRT_PICTURE like those allocated via RenderCreatePicture. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'render')
-rw-r--r--render/render.c137
1 files changed, 137 insertions, 0 deletions
diff --git a/render/render.c b/render/render.c
index 575bd9f9c..2d9e47a9c 100644
--- a/render/render.c
+++ b/render/render.c
@@ -3235,6 +3235,138 @@ PanoramiXRenderAddTraps (ClientPtr client)
return result;
}
+static int
+PanoramiXRenderCreateSolidFill (ClientPtr client)
+{
+ REQUEST(xRenderCreateSolidFillReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = 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_RenderCreateSolidFill]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateLinearGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateLinearGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = 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);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateRadialGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateRadialGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = 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);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateConicalGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateConicalGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = 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);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
void
PanoramiXRenderInit (void)
{
@@ -3264,6 +3396,11 @@ PanoramiXRenderInit (void)
ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip;
ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan;
ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps;
+
+ ProcRenderVector[X_RenderCreateSolidFill] = PanoramiXRenderCreateSolidFill;
+ ProcRenderVector[X_RenderCreateLinearGradient] = PanoramiXRenderCreateLinearGradient;
+ ProcRenderVector[X_RenderCreateRadialGradient] = PanoramiXRenderCreateRadialGradient;
+ ProcRenderVector[X_RenderCreateConicalGradient] = PanoramiXRenderCreateConicalGradient;
}
void