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

Method run

util/fbxtest.cpp:338–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336 iter(iter_), useShm(useShm_) {}
337
338 void run(void)
339 {
340 int i; fbx_struct fb;
341 memset(&fb, 0, sizeof(fb));
342
343 try
344 {
345 int myWidth, myHeight, myX = 0, myY = 0;
346
347 TRY_FBX(fbx_init(&fb, wh, 0, 0, useShm ? 1 : 0));
348 if(myRank < 2) { myWidth = fb.width / 2; myX = 0; }
349 else { myWidth = fb.width - fb.width / 2; myX = fb.width / 2; }
350 if(myRank % 2 == 0) { myHeight = fb.height / 2; myY = 0; }
351 else { myHeight = fb.height - fb.height / 2; myY = fb.height / 2; }
352 fbx_term(&fb);
353 TRY_FBX(fbx_init(&fb, wh, myWidth, myHeight, useShm ? 1 : 0));
354 if(useShm && !fb.shm) THROW("MIT-SHM not available");
355 initBuf(myX, myY, fb.width, fb.pitch, fb.height, fb.pf,
356 (unsigned char *)fb.bits, 0);
357 for(i = 0; i < iter; i++)
358 TRY_FBX(fbx_write(&fb, 0, 0, myX, myY, fb.width, fb.height));
359 fbx_term(&fb);
360 }
361 catch(...)
362 {
363 fbx_term(&fb); retCode = -1; throw;
364 }
365 }
366
367 private:
368

Callers

nothing calls this directly

Calls 3

fbx_termFunction · 0.85
fbx_writeFunction · 0.85
initBufFunction · 0.70

Tested by

no test coverage detected