本文整理汇总了C++中GetPictureScreen函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPictureScreen函数的具体用法?C++ GetPictureScreen怎么用?C++ GetPictureScreen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPictureScreen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dmxCompositeRects
/** Fill a rectangle on the appropriate screen by combining the color
* with the dest picture in the area specified by the list of
* rectangles. For a complete description see the protocol document of
* the RENDER library. */
void
dmxCompositeRects(CARD8 op,
PicturePtr pDst,
xRenderColor * color, int nRect, xRectangle *rects)
{
ScreenPtr pScreen = pDst->pDrawable->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PictureScreenPtr ps = GetPictureScreen(pScreen);
dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pDst);
DMX_UNWRAP(CompositeRects, dmxScreen, ps);
#if 0
if (ps->CompositeRects)
ps->CompositeRects(op, pDst, color, nRect, rects);
#endif
/* CompositeRects on back-end server */
if (pPictPriv->pict) {
XRenderFillRectangles(dmxScreen->beDisplay,
op,
pPictPriv->pict,
(XRenderColor *) color,
(XRectangle *) rects, nRect);
dmxSync(dmxScreen, FALSE);
}
DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps);
}
示例2: miChangePictureClip
int
miChangePictureClip(PicturePtr pPicture, int type, void *value, int n)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
RegionPtr clientClip;
switch (type) {
case CT_PIXMAP:
/* convert the pixmap to a region */
clientClip = BitmapToRegion(pScreen, (PixmapPtr) value);
if (!clientClip)
return BadAlloc;
(*pScreen->DestroyPixmap) ((PixmapPtr) value);
break;
case CT_REGION:
clientClip = value;
break;
case CT_NONE:
clientClip = 0;
break;
default:
clientClip = RegionFromRects(n, (xRectangle *) value, type);
if (!clientClip)
return BadAlloc;
free(value);
break;
}
(*ps->DestroyPictureClip) (pPicture);
pPicture->clientClip = clientClip;
pPicture->stateChanges |= CPClipMask;
return Success;
}
示例3: dmxPictureInit
/** Initialize the RENDER extension, allocate the picture privates and
* wrap mi function hooks. If the shadow frame buffer is used, then
* call the appropriate fb initialization function. */
Bool
dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PictureScreenPtr ps;
if (!miPictureInit(pScreen, formats, nformats))
return FALSE;
if (!dixRegisterPrivateKey
(&dmxPictPrivateKeyRec, PRIVATE_PICTURE, sizeof(dmxPictPrivRec)))
return FALSE;
ps = GetPictureScreen(pScreen);
DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps);
DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps);
DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps);
DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps);
DMX_WRAP(ChangePicture, dmxChangePicture, dmxScreen, ps);
DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps);
DMX_WRAP(Composite, dmxComposite, dmxScreen, ps);
DMX_WRAP(Glyphs, dmxGlyphs, dmxScreen, ps);
DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps);
DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps);
DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
return TRUE;
}
示例4: dmxDestroyPictureClip
/** Destroy the picture's list of clip rectangles. */
void
dmxDestroyPictureClip(PicturePtr pPicture)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PictureScreenPtr ps = GetPictureScreen(pScreen);
dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(DestroyPictureClip, dmxScreen, ps);
#if 1
if (ps->DestroyPictureClip)
ps->DestroyPictureClip(pPicture);
#endif
/* Destroy picture clip rects on back-end server */
if (pPictPriv->pict) {
XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
pPictPriv->pict, 0, 0, NULL, 0);
dmxSync(dmxScreen, FALSE);
}
else {
/* FIXME: Handle destroying clip region when offscreen */
}
DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps);
}
示例5: RootlessComposite
static void
RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
{
ScreenPtr pScreen = pDst->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
WindowPtr dstWin;
dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pDst->pDrawable : NULL;
// SCREEN_UNWRAP(ps, Composite);
ps->Composite = SCREENREC(pScreen)->Composite;
ps->Composite(op, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask,
xDst, yDst, width, height);
if (dstWin && IsFramedWindow(dstWin)) {
RootlessDamageRect(dstWin, xDst, yDst, width, height);
}
ps->Composite = RootlessComposite;
// SCREEN_WRAP(ps, Composite);
}
示例6: rdpGlyphs
void
rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat,
INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists,
GlyphPtr* glyphs)
{
PictureScreenPtr ps;
int index;
LLOGLN(10, ("rdpGlyphs:"));
LLOGLN(10, ("rdpGlyphs: nlists %d len %d", nlists, lists->len));
rdpup_set_hints(1, 1);
for (index = 0; index < lists->len; index++)
{
LLOGLN(10, (" index %d size %d refcnt %d width %d height %d",
index, (int)(glyphs[index]->size), (int)(glyphs[index]->refcnt),
glyphs[index]->info.width, glyphs[index]->info.height));
}
ps = GetPictureScreen(g_pScreen);
ps->Glyphs = g_rdpScreen.Glyphs;
ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc,
nlists, lists, glyphs);
ps->Glyphs = rdpGlyphs;
rdpup_set_hints(0, 1);
LLOGLN(10, ("rdpGlyphs: out"));
}
示例7: LayerFinishInit
Bool
LayerFinishInit (ScreenPtr pScreen)
{
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreen (pScreen);
#endif
pScreen->CloseScreen = layerCloseScreen;
pScreen->CreateWindow = layerCreateWindow;
pScreen->DestroyWindow = layerDestroyWindow;
pScreen->ChangeWindowAttributes = layerChangeWindowAttributes;
pScreen->PaintWindowBackground = layerPaintWindowBackground;
pScreen->PaintWindowBorder = layerPaintWindowBorder;
pScreen->CopyWindow = layerCopyWindow;
pScreen->CreatePixmap = layerCreatePixmap;
pScreen->DestroyPixmap = layerDestroyPixmap;
pScreen->CreateGC = layerCreateGC;
#ifdef RENDER
if (ps)
{
ps->Composite = layerComposite;
ps->Glyphs = layerGlyphs;
ps->CompositeRects = layerCompositeRects;
}
#endif
return TRUE;
}
示例8: PictureSetFilterAlias
_X_EXPORT Bool
PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
int filter_id = PictureGetFilterId (filter, -1, FALSE);
int alias_id = PictureGetFilterId (alias, -1, TRUE);
int i;
if (filter_id < 0 || alias_id < 0)
return FALSE;
for (i = 0; i < ps->nfilterAliases; i++)
if (ps->filterAliases[i].alias_id == alias_id)
break;
if (i == ps->nfilterAliases)
{
PictFilterAliasPtr aliases;
if (ps->filterAliases)
aliases = xrealloc (ps->filterAliases,
(ps->nfilterAliases + 1) *
sizeof (PictFilterAliasRec));
else
aliases = xalloc (sizeof (PictFilterAliasRec));
if (!aliases)
return FALSE;
ps->filterAliases = aliases;
ps->filterAliases[i].alias = PictureGetFilterName (alias_id);
ps->filterAliases[i].alias_id = alias_id;
ps->nfilterAliases++;
}
ps->filterAliases[i].filter_id = filter_id;
return TRUE;
}
示例9: PictureAddFilter
_X_EXPORT int
PictureAddFilter (ScreenPtr pScreen,
char *filter,
PictFilterValidateParamsProcPtr ValidateParams)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
int id = PictureGetFilterId (filter, -1, TRUE);
int i;
PictFilterPtr filters;
if (id < 0)
return -1;
/*
* It's an error to attempt to reregister a filter
*/
for (i = 0; i < ps->nfilters; i++)
if (ps->filters[i].id == id)
return -1;
if (ps->filters)
filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
else
filters = xalloc (sizeof (PictFilterRec));
if (!filters)
return -1;
ps->filters = filters;
i = ps->nfilters++;
ps->filters[i].name = PictureGetFilterName (id);
ps->filters[i].id = id;
ps->filters[i].ValidateParams = ValidateParams;
return id;
}
示例10: xprSetupScreen
/*
* xprSetupScreen
* Setup the screen for rootless access.
*/
static Bool
xprSetupScreen(int index, ScreenPtr pScreen)
{
// Add alpha protecting replacements for fb screen functions
pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
#ifdef RENDER
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
ps->Composite = SafeAlphaComposite;
}
#endif /* RENDER */
// Initialize accelerated rootless drawing
// Note that this must be done before DamageSetup().
RootlessAccelInit(pScreen);
#ifdef DAMAGE
// The Damage extension needs to wrap underneath the
// generic rootless layer, so do it now.
if (!DamageSetup(pScreen))
return FALSE;
#endif
// Initialize generic rootless code
if (!xprInit(pScreen))
return FALSE;
return DRIFinishScreenInit(pScreen);
}
示例11: rdpComposite
void
rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst,
INT16 yDst, CARD16 width, CARD16 height)
{
ScreenPtr pScreen;
rdpPtr dev;
PictureScreenPtr ps;
BoxRec box;
RegionRec reg;
LLOGLN(10, ("rdpComposite:"));
pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCompositeCallCount++;
box.x1 = xDst + pDst->pDrawable->x;
box.y1 = yDst + pDst->pDrawable->y;
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
rdpRegionInit(®, &box, 0);
if (pDst->pCompositeClip != NULL)
{
rdpRegionIntersect(®, pDst->pCompositeClip, ®);
}
ps = GetPictureScreen(pScreen);
/* do original call */
rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc,
xMask, yMask, xDst, yDst, width, height);
rdpClientConAddAllReg(dev, ®, pDst->pDrawable);
rdpRegionUninit(®);
}
示例12: dmxChangePictureClip
/** Change the picture's list of clip rectangles. */
int dmxChangePictureClip(PicturePtr pPicture, int clipType,
pointer value, int n)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PictureScreenPtr ps = GetPictureScreen(pScreen);
dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(ChangePictureClip, dmxScreen, ps);
#if 1
if (ps->ChangePictureClip)
ps->ChangePictureClip(pPicture, clipType, value, n);
#endif
/* Change picture clip rects on back-end server */
if (pPictPriv->pict) {
/* The clip has already been changed into a region by the mi
* routine called above.
*/
if (pPicture->clientClip) {
RegionPtr pClip = pPicture->clientClip;
BoxPtr pBox = REGION_RECTS(pClip);
int nBox = REGION_NUM_RECTS(pClip);
XRectangle *pRects;
XRectangle *pRect;
int nRects;
nRects = nBox;
pRects = pRect = xalloc(nRects * sizeof(*pRect));
while (nBox--) {
pRect->x = pBox->x1;
pRect->y = pBox->y1;
pRect->width = pBox->x2 - pBox->x1;
pRect->height = pBox->y2 - pBox->y1;
pBox++;
pRect++;
}
XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
pPictPriv->pict,
0, 0,
pRects,
nRects);
xfree(pRects);
} else {
XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
pPictPriv->pict,
0, 0, NULL, 0);
}
dmxSync(dmxScreen, FALSE);
} else {
/* FIXME: Handle saving clip region when offscreen */
}
DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps);
return Success;
}
示例13: KdPictureInitAsync
void
KdPictureInitAsync (ScreenPtr pScreen)
{
PictureScreenPtr ps;
ps = GetPictureScreen(pScreen);
ps->Composite = KdCheckComposite;
}
示例14: GlyphUninit
void
GlyphUninit (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen (pScreen);
GlyphPtr glyph;
int fdepth, i;
globalTotalGlyphPrivateSize -= ps->totalGlyphPrivateSize;
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
{
if (!globalGlyphs[fdepth].hashSet)
continue;
for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++)
{
glyph = globalGlyphs[fdepth].table[i].glyph;
if (glyph && glyph != DeletedGlyph)
{
(*ps->UnrealizeGlyph) (pScreen, glyph);
if (globalTotalGlyphPrivateSize)
{
if (!ReallocGlobalGlyphPrivate (glyph))
return;
}
else
{
if (glyph->devPrivates)
xfree (glyph->devPrivates);
glyph->devPrivates = NULL;
}
}
}
}
if (globalTotalGlyphPrivateSize)
SetGlyphScreenPrivateOffsets ();
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
{
if (!globalGlyphs[fdepth].hashSet)
continue;
for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++)
{
glyph = globalGlyphs[fdepth].table[i].glyph;
if (glyph && glyph != DeletedGlyph)
{
if (globalTotalGlyphPrivateSize)
SetGlyphPrivatePointers (glyph);
}
}
}
if (ps->glyphPrivateSizes)
xfree (ps->glyphPrivateSizes);
}
示例15: PictureResetFilters
void
PictureResetFilters (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
xfree (ps->filters);
xfree (ps->filterAliases);
PictureFreeFilterIds ();
}