render/exa: use glyph picture accessors
use the glyph picture accessors in the X server, render and EXA code. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
a45e1d6cc6
commit
cc4fe613d0
|
@ -365,7 +365,7 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen,
|
||||||
ExaGlyphCachePtr cache, int x, int y, GlyphPtr pGlyph)
|
ExaGlyphCachePtr cache, int x, int y, GlyphPtr pGlyph)
|
||||||
{
|
{
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum];
|
PicturePtr pGlyphPicture = GetGlyphPicture(pGlyph, pScreen);
|
||||||
PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable;
|
PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable;
|
||||||
|
|
||||||
ExaPixmapPriv(pGlyphPixmap);
|
ExaPixmapPriv(pGlyphPixmap);
|
||||||
|
@ -544,7 +544,7 @@ exaBufferGlyph(ScreenPtr pScreen,
|
||||||
INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst)
|
INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst)
|
||||||
{
|
{
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format;
|
unsigned int format = (GetGlyphPicture(pGlyph, pScreen))->format;
|
||||||
int width = pGlyph->info.width;
|
int width = pGlyph->info.width;
|
||||||
int height = pGlyph->info.height;
|
int height = pGlyph->info.height;
|
||||||
ExaCompositeRectPtr rect;
|
ExaCompositeRectPtr rect;
|
||||||
|
@ -586,7 +586,7 @@ exaBufferGlyph(ScreenPtr pScreen,
|
||||||
|
|
||||||
/* Couldn't find the glyph in the cache, use the glyph picture directly */
|
/* Couldn't find the glyph in the cache, use the glyph picture directly */
|
||||||
|
|
||||||
mask = GlyphPicture(pGlyph)[pScreen->myNum];
|
mask = GetGlyphPicture(pGlyph, pScreen);
|
||||||
if (buffer->mask && buffer->mask != mask)
|
if (buffer->mask && buffer->mask != mask)
|
||||||
return ExaGlyphNeedFlush;
|
return ExaGlyphNeedFlush;
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@ GlyphUninit(ScreenPtr pScreen)
|
||||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||||
GlyphPtr glyph;
|
GlyphPtr glyph;
|
||||||
int fdepth, i;
|
int fdepth, i;
|
||||||
int scrno = pScreen->myNum;
|
|
||||||
|
|
||||||
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++) {
|
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++) {
|
||||||
if (!globalGlyphs[fdepth].hashSet)
|
if (!globalGlyphs[fdepth].hashSet)
|
||||||
|
@ -99,9 +98,9 @@ GlyphUninit(ScreenPtr pScreen)
|
||||||
for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++) {
|
for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++) {
|
||||||
glyph = globalGlyphs[fdepth].table[i].glyph;
|
glyph = globalGlyphs[fdepth].table[i].glyph;
|
||||||
if (glyph && glyph != DeletedGlyph) {
|
if (glyph && glyph != DeletedGlyph) {
|
||||||
if (GlyphPicture(glyph)[scrno]) {
|
if (GetGlyphPicture(glyph, pScreen)) {
|
||||||
FreePicture((pointer) GlyphPicture(glyph)[scrno], 0);
|
FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0);
|
||||||
GlyphPicture(glyph)[scrno] = NULL;
|
SetGlyphPicture(glyph, pScreen, NULL);
|
||||||
}
|
}
|
||||||
(*ps->UnrealizeGlyph) (pScreen, glyph);
|
(*ps->UnrealizeGlyph) (pScreen, glyph);
|
||||||
}
|
}
|
||||||
|
@ -239,8 +238,8 @@ FreeGlyphPicture(GlyphPtr glyph)
|
||||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||||
ScreenPtr pScreen = screenInfo.screens[i];
|
ScreenPtr pScreen = screenInfo.screens[i];
|
||||||
|
|
||||||
if (GlyphPicture(glyph)[i])
|
if (GetGlyphPicture(glyph, pScreen))
|
||||||
FreePicture((pointer) GlyphPicture(glyph)[i], 0);
|
FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0);
|
||||||
|
|
||||||
ps = GetPictureScreenIfSet(pScreen);
|
ps = GetPictureScreenIfSet(pScreen);
|
||||||
if (ps)
|
if (ps)
|
||||||
|
@ -363,11 +362,12 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth)
|
||||||
dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
|
dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||||
GlyphPicture(glyph)[i] = NULL;
|
ScreenPtr pScreen = screenInfo.screens[i];
|
||||||
ps = GetPictureScreenIfSet(screenInfo.screens[i]);
|
SetGlyphPicture(glyph, pScreen, NULL);
|
||||||
|
ps = GetPictureScreenIfSet(pScreen);
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
if (!(*ps->RealizeGlyph) (screenInfo.screens[i], glyph))
|
if (!(*ps->RealizeGlyph) (pScreen, glyph))
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,7 +638,7 @@ miGlyphs(CARD8 op,
|
||||||
n = list->len;
|
n = list->len;
|
||||||
while (n--) {
|
while (n--) {
|
||||||
glyph = *glyphs++;
|
glyph = *glyphs++;
|
||||||
pPicture = GlyphPicture(glyph)[pScreen->myNum];
|
pPicture = GetGlyphPicture(glyph, pScreen);
|
||||||
|
|
||||||
if (pPicture) {
|
if (pPicture) {
|
||||||
if (maskFormat) {
|
if (maskFormat) {
|
||||||
|
|
|
@ -1136,11 +1136,11 @@ ProcRenderAddGlyphs(ClientPtr client)
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
GlyphPicture(glyph)[screen] = pDst =
|
pDst = CreatePicture(0, &pDstPix->drawable,
|
||||||
CreatePicture(0, &pDstPix->drawable,
|
|
||||||
glyphSet->format,
|
glyphSet->format,
|
||||||
CPComponentAlpha, &component_alpha,
|
CPComponentAlpha, &component_alpha,
|
||||||
serverClient, &error);
|
serverClient, &error);
|
||||||
|
SetGlyphPicture(glyph, pScreen, pDst);
|
||||||
|
|
||||||
/* The picture takes a reference to the pixmap, so we
|
/* The picture takes a reference to the pixmap, so we
|
||||||
drop ours. */
|
drop ours. */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user