PixmapObjectType *GetNextPot( WindowObjectType *wo ) { PixmapObjectType **p; int i; for( i = 0, p = wo->pixmapObjects; i < MAXPIXMAPOBJS; i++, p++ ) { if( ! *p ) break; if( !(*p)->inUse ) break; } if( ! (*p) && i >= MAXPIXMAPOBJS ) { printf( "GetNextPot: Out of PixmapObjects.\n"); return( (PixmapObjectType *) NULL ); } if( ! *p ) *p = CreatePot( wo ); (*p)->inUse = True; (*p)->inLoop = True; ClearPixmap( wo, (*p)->pixmap ); wo->numPixmapObjects++; return( *p ); }
void PixmapObjectResize( WindowObjectType *wo, PixmapObjectType *pot, Dimension width, Dimension height) { int numMetObjects; int i; MetObjectType **mot; pot->width = width; pot->height = height; FreePixmap( GetWindowObjectDisplay( wo ), pot->pixmap ); /* * Recreate the Pixmap from the window object. */ pot->pixmap = CreatePixmapFromWindowObject( wo ); ClearPixmap( wo, pot->pixmap ); numMetObjects = pot->numMetObjects; for( i = 0, mot = pot->metObjects; i < numMetObjects; i++, mot++ ) { SetMetObjectDrawnFlag( *mot, False ); } return; }
/* * Clear out the pixmap for this Object. */ void ClearPot( WindowObjectType *wo, PixmapObjectType *po ) { assert( po ); ClearPixmap( wo, po->pixmap ); return; }
void PixmapCacheManager::CheckCache () { while (MaxSize_ < CurrentSize_ && RecentlyUsed_.size () > 2) { auto page = RecentlyUsed_.takeFirst (); const quint64 pxSize = GetPixmapSize (page->pixmap ()); CurrentSize_ -= pxSize; page->ClearPixmap (); } }
/* * Clear out all the pixmaps for window Object. */ void ClearAllPots( WindowObjectType *wo ) { int i; PixmapObjectType **p; assert( wo ); for( p = wo->pixmapObjects; *p; p++ ) { if( ! (*p)->inUse ) continue; ClearPixmap( wo, (*p)->pixmap ); } return; }
/* -------------------------------------------------------------------- */ void PlotDifference(Widget w, XtPointer client, XmDrawingAreaCallbackStruct *call) { XFontStruct *fontInfo; /* If there are more Expose Events on the queue, then ignore this * one. */ if (diffPlot.windowOpen == false || (call && call->event && call->reason == XmCR_EXPOSE && ((XExposeEvent *)call->event)->count > 0)) return; if (DataChanged) ComputeDiff(); XSetClipMask(diffPlot.dpy, diffPlot.gc, None); ClearPixmap(&diffPlot); XDrawRectangle( diffPlot.dpy, diffPlot.win, diffPlot.gc, diffPlot.x.LV, diffPlot.x.TH, diffPlot.x.HD, diffPlot.x.VD); if (dataFile[dataSet[0].fileIndex].ShowPrelimDataWarning || dataFile[dataSet[1].fileIndex].ShowPrelimDataWarning) plotWarningX(&diffPlot, fontOffset); plotLabelsX(&diffPlot, fontOffset); fontInfo = diffPlot.fontInfo[3+fontOffset]; XSetFont(diffPlot.dpy, diffPlot.gc, fontInfo->fid); if (NumberDataFiles > 0 && NumberDataSets >= 2) { yTicsLabelsX(&diffPlot, fontInfo, LEFT_SIDE, true); xTicsLabelsX(&diffPlot, fontInfo, true); plotDiffLines(&diffPlot); } XCopyArea(diffPlot.dpy, diffPlot.win, XtWindow(diffPlot.canvas), diffPlot.gc, 0, 0, diffPlot.x.windowWidth, diffPlot.x.windowHeight, 0, 0); } /* END PLOTDIFFERENCE */
int __stdcall srv_2d(ioctl_t *io) { u32_t *inp; u32_t *outp; inp = io->input; outp = io->output; switch(io->io_code) { case SRV_GETVERSION: if(io->out_size==4) { *outp = API_VERSION; return 0; } break; case PX_CREATE: if(io->inp_size==7) return CreatePixmap((pixmap_t*)inp); break; case PX_DESTROY: if(io->inp_size==7) return DestroyPixmap((pixmap_t*)inp); break; case PX_CLEAR: if(io->inp_size==2) return ClearPixmap((io_clear_t*)inp); break; case PX_DRAW_RECT: if(io->inp_size==7) return DrawRect((io_draw_t*)inp); break; case PX_FILL_RECT: if(io->inp_size==10) return FillRect((io_fill_t*)inp); break; case PX_LINE: if(io->inp_size==6) return Line((io_draw_t*)inp); break; case PX_BLIT: if(io->inp_size==8) return Blit((io_blit_t*)inp); break; case PX_BLIT_TRANSPARENT: if(io->inp_size==9) return BlitTransparent((io_blit_t*)inp); break; case PX_BLIT_ALPHA: if(io->inp_size==9) return RadeonComposite((io_blit_t*)inp); break; default: return ERR_PARAM; }; return ERR_PARAM; }