aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-04 19:13:27 +0000
committermarha <marha@users.sourceforge.net>2009-10-04 19:13:27 +0000
commit77a4732b0637493966889fe3545966fdc12a1b5e (patch)
tree42ab7f9667a7b3bdd89e6bb5c50793dad170b974 /xorg-server/glx
parent67b353c9ce039b254ba2e92cd6f842c505a8bd21 (diff)
downloadvcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.tar.gz
vcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.tar.bz2
vcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.zip
Updated to
xkeyboard-config-1.7 pixman-0.16.2 libX11-1.3 libXinerama-1.1 xkbcomp-1.1.1 recordproto-1.14 xineramaproto-1.2 inputproto-2.0 compositeproto-0.4.1 xorg-server-1.7.0
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/glxscreens.c58
1 files changed, 3 insertions, 55 deletions
diff --git a/xorg-server/glx/glxscreens.c b/xorg-server/glx/glxscreens.c
index 81faddd04..7d29d31de 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -250,12 +250,8 @@ GLint glxConvertToXVisualType(int visualType)
static VisualPtr
AddScreenVisuals(ScreenPtr pScreen, int count, int d)
{
- XID *installedCmaps, *vids, vid;
- int numInstalledCmaps, numVisuals, i, j;
- VisualPtr visuals;
- ColormapPtr installedCmap;
+ int i;
DepthPtr depth;
- int rc;
depth = NULL;
for (i = 0; i < pScreen->numDepths; i++) {
@@ -267,56 +263,8 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
if (depth == NULL)
return NULL;
- /* Find the installed colormaps */
- installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
- if (!installedCmaps)
- return NULL;
-
- numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen, installedCmaps);
-
- /* realloc the visual array to fit the new one in place */
- numVisuals = pScreen->numVisuals;
- visuals = xrealloc(pScreen->visuals, (numVisuals + count) * sizeof(VisualRec));
- if (!visuals) {
- xfree(installedCmaps);
- return NULL;
- }
-
- vids = xrealloc(depth->vids, (depth->numVids + count) * sizeof(XID));
- if (vids == NULL) {
- xfree(installedCmaps);
- xfree(visuals);
- return NULL;
- }
-
- /*
- * Fix up any existing installed colormaps -- we'll assume that
- * the only ones created so far have been installed. If this
- * isn't true, we'll have to walk the resource database looking
- * for all colormaps.
- */
- for (i = 0; i < numInstalledCmaps; i++) {
- rc = dixLookupResourceByType((pointer *)&installedCmap,
- installedCmaps[i], RT_COLORMAP,
- serverClient, DixReadAccess);
- if (rc != Success)
- continue;
- j = installedCmap->pVisual - pScreen->visuals;
- installedCmap->pVisual = &visuals[j];
- }
-
- xfree(installedCmaps);
-
- for (i = 0; i < count; i++) {
- vid = FakeClientID(0);
- visuals[pScreen->numVisuals + i].vid = vid;
- vids[depth->numVids + i] = vid;
- }
-
- pScreen->visuals = visuals;
- pScreen->numVisuals += count;
- depth->vids = vids;
- depth->numVids += count;
+ if (ResizeVisualArray(pScreen, count, depth) == FALSE)
+ return NULL;
/* Return a pointer to the first of the added visuals. */
return pScreen->visuals + pScreen->numVisuals - count;