Lines Matching +full:depth +full:-
31 #include <dix-config.h>
48 *pmaps = GetInstalledmiColormap(pScreen)->mid; in miListInstalledColormaps()
57 ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen); in miInstallColormap()
63 WalkTree(pmap->pScreen, TellLostMap, (char *) &oldpmap->mid); in miInstallColormap()
65 SetInstalledmiColormap(pmap->pScreen, pmap); in miInstallColormap()
66 WalkTree(pmap->pScreen, TellGainedMap, (char *) &pmap->mid); in miInstallColormap()
74 ColormapPtr curpmap = GetInstalledmiColormap(pmap->pScreen); in miUninstallColormap()
77 if (pmap->mid != pmap->pScreen->defColormap) { in miUninstallColormap()
79 pmap->pScreen->defColormap, in miUninstallColormap()
81 (*pmap->pScreen->InstallColormap) (curpmap); in miUninstallColormap()
90 int shift = 16 - pVisual->bitsPerRGBValue; in miResolveColor()
91 unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1; in miResolveColor()
93 if ((pVisual->class | DynamicClass) == GrayScale) { in miResolveColor()
113 pVisual = pmap->pVisual; in miInitializeColormap()
114 lim = (1 << pVisual->bitsPerRGBValue) - 1; in miInitializeColormap()
115 shift = 16 - pVisual->bitsPerRGBValue; in miInitializeColormap()
116 maxent = pVisual->ColormapEntries - 1; in miInitializeColormap()
117 if (pVisual->class == TrueColor) { in miInitializeColormap()
120 limr = pVisual->redMask >> pVisual->offsetRed; in miInitializeColormap()
121 limg = pVisual->greenMask >> pVisual->offsetGreen; in miInitializeColormap()
122 limb = pVisual->blueMask >> pVisual->offsetBlue; in miInitializeColormap()
125 pmap->red[i].co.local.red = in miInitializeColormap()
127 pmap->green[i].co.local.green = in miInitializeColormap()
129 pmap->blue[i].co.local.blue = in miInitializeColormap()
133 else if (pVisual->class == StaticColor) { in miInitializeColormap()
136 limr = pVisual->redMask >> pVisual->offsetRed; in miInitializeColormap()
137 limg = pVisual->greenMask >> pVisual->offsetGreen; in miInitializeColormap()
138 limb = pVisual->blueMask >> pVisual->offsetBlue; in miInitializeColormap()
141 pmap->red[i].co.local.red = in miInitializeColormap()
142 ((((((i & pVisual->redMask) >> pVisual->offsetRed) in miInitializeColormap()
144 pmap->red[i].co.local.green = in miInitializeColormap()
145 ((((((i & pVisual->greenMask) >> pVisual->offsetGreen) in miInitializeColormap()
147 pmap->red[i].co.local.blue = in miInitializeColormap()
148 ((((((i & pVisual->blueMask) >> pVisual->offsetBlue) in miInitializeColormap()
152 else if (pVisual->class == StaticGray) { in miInitializeColormap()
155 pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift) in miInitializeColormap()
157 pmap->red[i].co.local.green = pmap->red[i].co.local.red; in miInitializeColormap()
158 pmap->red[i].co.local.blue = pmap->red[i].co.local.red; in miInitializeColormap()
180 outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
181 outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
182 outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
197 pVisual = pmap->pVisual; in miExpandDirectColors()
199 stepred = 1 << pVisual->offsetRed; in miExpandDirectColors()
200 stepgreen = 1 << pVisual->offsetGreen; in miExpandDirectColors()
201 stepblue = 1 << pVisual->offsetBlue; in miExpandDirectColors()
202 maxred = pVisual->redMask; in miExpandDirectColors()
203 maxgreen = pVisual->greenMask; in miExpandDirectColors()
204 maxblue = pVisual->blueMask; in miExpandDirectColors()
206 for (; ndef--; indefs++) { in miExpandDirectColors()
207 if (indefs->flags & DoRed) { in miExpandDirectColors()
208 red = indefs->pixel & pVisual->redMask; in miExpandDirectColors()
215 if (indefs->flags & DoGreen) { in miExpandDirectColors()
216 green = indefs->pixel & pVisual->greenMask; in miExpandDirectColors()
223 if (indefs->flags & DoBlue) { in miExpandDirectColors()
224 blue = indefs->pixel & pVisual->blueMask; in miExpandDirectColors()
247 for (pVisual = pScreen->visuals; in miCreateDefColormap()
248 pVisual->vid != pScreen->rootVisual; pVisual++); in miCreateDefColormap()
250 if (pScreen->rootDepth == 1 || (pVisual->class & DynamicClass)) in miCreateDefColormap()
255 if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap, in miCreateDefColormap()
259 if (pScreen->rootDepth > 1) { in miCreateDefColormap()
260 wp = pScreen->whitePixel; in miCreateDefColormap()
261 bp = pScreen->blackPixel; in miCreateDefColormap()
266 pScreen->whitePixel = wp; in miCreateDefColormap()
267 pScreen->blackPixel = bp; in miCreateDefColormap()
270 (*pScreen->InstallColormap) (cmap); in miCreateDefColormap()
281 #define _RM(d) ((1 << _RZ(d)) - 1)
282 #define _GZ(d) ((d - _RZ(d) + 1) / 2)
284 #define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
285 #define _BZ(d) (d - _RZ(d) - _GZ(d))
287 #define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
292 int depth; member
314 miVisuals = v->next; in miClearVisualTypes()
320 miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, in miSetVisualTypesAndMasks() argument
331 redMask = _RM(depth); in miSetVisualTypesAndMasks()
332 greenMask = _GM(depth); in miSetVisualTypesAndMasks()
333 blueMask = _BM(depth); in miSetVisualTypesAndMasks()
335 new->next = 0; in miSetVisualTypesAndMasks()
336 new->depth = depth; in miSetVisualTypesAndMasks()
337 new->visuals = visuals; in miSetVisualTypesAndMasks()
338 new->bitsPerRGB = bitsPerRGB; in miSetVisualTypesAndMasks()
339 new->preferredCVC = preferredCVC; in miSetVisualTypesAndMasks()
340 new->redMask = redMask; in miSetVisualTypesAndMasks()
341 new->greenMask = greenMask; in miSetVisualTypesAndMasks()
342 new->blueMask = blueMask; in miSetVisualTypesAndMasks()
344 count = visuals - count - ((count >> 1) & 033333333333); in miSetVisualTypesAndMasks()
346 new->count = count; in miSetVisualTypesAndMasks()
347 for (prev = &miVisuals; (v = *prev); prev = &v->next); in miSetVisualTypesAndMasks()
353 miSetVisualTypes(int depth, int visuals, int bitsPerRGB, int preferredCVC) in miSetVisualTypes() argument
355 return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, in miSetVisualTypes()
360 miGetDefaultVisualMask(int depth) in miGetDefaultVisualMask() argument
362 if (depth > MAX_PSEUDO_DEPTH) in miGetDefaultVisualMask()
364 else if (depth >= MIN_TRUE_DEPTH) in miGetDefaultVisualMask()
366 else if (depth == 1) in miGetDefaultVisualMask()
373 miVisualTypesSet(int depth) in miVisualTypesSet() argument
377 for (visuals = miVisuals; visuals; visuals = visuals->next) in miVisualTypesSet()
378 if (visuals->depth == depth) in miVisualTypesSet()
390 d = screenInfo.formats[f].depth; in miSetPixmapDepths()
392 if (!miSetVisualTypes(d, 0, 0, -1)) in miSetPixmapDepths()
430 DepthPtr depth; in miInitVisuals() local
444 d = screenInfo.formats[f].depth; in miInitVisuals()
446 if (sizes & (1 << (b - 1))) in miInitVisuals()
450 if (!miSetVisualTypes(d, vtype, bitsPerRGB, -1)) in miInitVisuals()
457 nextVisuals = visuals->next; in miInitVisuals()
459 nvisual += visuals->count; in miInitVisuals()
461 depth = xallocarray(ndepth, sizeof(DepthRec)); in miInitVisuals()
464 if (!depth || !visual || !preferredCVCs) { in miInitVisuals()
465 free(depth); in miInitVisuals()
470 *depthp = depth; in miInitVisuals()
476 nextVisuals = visuals->next; in miInitVisuals()
477 d = visuals->depth; in miInitVisuals()
478 vtype = visuals->visuals; in miInitVisuals()
479 nvtype = visuals->count; in miInitVisuals()
480 *prefp = visuals->preferredCVC; in miInitVisuals()
486 free(depth); in miInitVisuals()
492 depth->depth = d; in miInitVisuals()
493 depth->numVids = nvtype; in miInitVisuals()
494 depth->vids = vid; in miInitVisuals()
495 depth++; in miInitVisuals()
499 visual->class = miVisualPriority[i]; in miInitVisuals()
500 visual->bitsPerRGBValue = visuals->bitsPerRGB; in miInitVisuals()
501 visual->ColormapEntries = 1 << d; in miInitVisuals()
502 visual->nplanes = d; in miInitVisuals()
503 visual->vid = *vid = FakeClientID(0); in miInitVisuals()
504 switch (visual->class) { in miInitVisuals()
508 visual->redMask = 0; in miInitVisuals()
509 visual->greenMask = 0; in miInitVisuals()
510 visual->blueMask = 0; in miInitVisuals()
511 visual->offsetRed = 0; in miInitVisuals()
512 visual->offsetGreen = 0; in miInitVisuals()
513 visual->offsetBlue = 0; in miInitVisuals()
517 visual->ColormapEntries = _CE(d); in miInitVisuals()
520 visual->redMask = visuals->redMask; in miInitVisuals()
521 visual->greenMask = visuals->greenMask; in miInitVisuals()
522 visual->blueMask = visuals->blueMask; in miInitVisuals()
523 visual->offsetRed = maskShift(visuals->redMask); in miInitVisuals()
524 visual->offsetGreen = maskShift(visuals->greenMask); in miInitVisuals()
525 visual->offsetBlue = maskShift(visuals->blueMask); in miInitVisuals()
534 depth = *depthp; in miInitVisuals()
538 * check if there is a preferred class in one of the depth in miInitVisuals()
539 * structures - if there is, we want to start looking for the in miInitVisuals()
540 * default visual/depth from that depth. in miInitVisuals()
553 int prefColorVisualClass = -1; in miInitVisuals()
562 if (*rootDepthp && *rootDepthp != depth[i].depth) in miInitVisuals()
565 for (j = 0; j < depth[i].numVids; j++) { in miInitVisuals()
567 if (visual[k].vid == depth[i].vids[j]) in miInitVisuals()
575 if (j != depth[i].numVids) in miInitVisuals()
582 *rootDepthp = depth[i].depth; in miInitVisuals()
583 *defaultVisp = depth[i].vids[j]; in miInitVisuals()