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

Method run

client/ClientWin.cpp:200–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200void ClientWin::run(void)
201{
202 Profiler pt("Total "), pb("Blit "), pd("Decompress");
203 Frame *f = NULL; long bytes = 0;
204
205 try
206 {
207 while(!deadYet)
208 {
209 void *ftemp = NULL;
210 q.get(&ftemp); f = (Frame *)ftemp; if(deadYet) break;
211 if(!f)
212 throw(Error("ClientWin::run()", "Invalid image received from queue"));
213 CriticalSection::SafeLock l(mutex);
214 #ifdef USEXV
215 if(f->isXV)
216 {
217 if(f->hdr.flags != RR_EOF)
218 {
219 pb.startFrame();
220 ((XVFrame *)f)->redraw();
221 pb.endFrame(f->hdr.width * f->hdr.height, 0, 1);
222 pt.endFrame(f->hdr.width * f->hdr.height, bytes, 1);
223 bytes = 0;
224 pt.startFrame();
225 }
226 }
227 else
228 #endif
229 {
230 if(f->hdr.flags == RR_EOF)
231 {
232 pb.startFrame();
233 if(fb->isGL) ((GLFrame *)fb)->init(f->hdr, stereo);
234 else ((FBXFrame *)fb)->init(f->hdr);
235 if(fb->isGL) ((GLFrame *)fb)->redraw();
236 else ((FBXFrame *)fb)->redraw();
237 pb.endFrame(fb->hdr.framew * fb->hdr.frameh, 0, 1);
238 pt.endFrame(fb->hdr.framew * fb->hdr.frameh, bytes, 1);
239 bytes = 0;
240 pt.startFrame();
241 }
242 else
243 {
244 pd.startFrame();
245 if(fb->isGL) *((GLFrame *)fb) = *((CompressedFrame *)f);
246 else *((FBXFrame *)fb) = *((CompressedFrame *)f);
247 pd.endFrame(f->hdr.width * f->hdr.height, 0,
248 (double)(f->hdr.width * f->hdr.height) /
249 (double)(f->hdr.framew * f->hdr.frameh));
250 bytes += f->hdr.size;
251 }
252 }
253 f->signalComplete();
254 }
255
256 }
257 catch(std::exception &e)

Callers

nothing calls this directly

Calls 8

startFrameMethod · 0.80
endFrameMethod · 0.80
signalCompleteMethod · 0.80
setErrorMethod · 0.80
ErrorClass · 0.50
getMethod · 0.45
redrawMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected