MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / getFrame

Method getFrame

server/X11Trans.cpp:112–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112FBXFrame *X11Trans::getFrame(Display *dpy, Window win, int width, int height)
113{
114 FBXFrame *f = NULL;
115
116 if(thread) thread->checkError();
117 {
118 CriticalSection::SafeLock l(mutex);
119
120 int index = -1;
121 for(int i = 0; i < nFrames; i++)
122 if(!frames[i] || (frames[i] && frames[i]->isComplete()))
123 index = i;
124 if(index < 0) THROW("No free buffers in pool");
125 if(!frames[index])
126 frames[index] = new FBXFrame(dpy, win, NULL, fconfig.sync);
127 f = frames[index]; f->waitUntilComplete();
128 }
129
130 rrframeheader hdr;
131 memset(&hdr, 0, sizeof(hdr));
132 hdr.x = hdr.y = 0;
133 hdr.width = hdr.framew = width;
134 hdr.height = hdr.frameh = height;
135 f->init(hdr);
136 return f;
137}
138
139
140bool X11Trans::isReady(void)

Callers

nothing calls this directly

Calls 4

checkErrorMethod · 0.80
isCompleteMethod · 0.80
waitUntilCompleteMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected