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

Method run

util/fbxtest.cpp:381–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379 iter(iter_), useShm(useShm_) {}
380
381 void run(void)
382 {
383 fbx_struct fb;
384 memset(&fb, 0, sizeof(fb));
385
386 try
387 {
388 int i, myWidth, myHeight, myX = 0, myY = 0;
389
390 TRY_FBX(fbx_init(&fb, wh, 0, 0, useShm ? 1 : 0));
391 if(myRank < 2) { myWidth = fb.width / 2; myX = 0; }
392 else { myWidth = fb.width - fb.width / 2; myX = fb.width / 2; }
393 if(myRank % 2 == 0) { myHeight = fb.height / 2; myY = 0; }
394 else { myHeight = fb.height - fb.height / 2; myY = fb.height / 2; }
395 fbx_term(&fb);
396 TRY_FBX(fbx_init(&fb, wh, myWidth, myHeight, useShm ? 1 : 0));
397 if(useShm && !fb.shm) THROW("MIT-SHM not available");
398 memset(fb.bits, 0, fb.width * fb.height * fb.pf->size);
399 for(i = 0; i < iter; i++)
400 TRY_FBX(fbx_read(&fb, myX, myY));
401 if(!cmpBuf(myX, myY, fb.width, fb.pitch, fb.height, fb.pf,
402 (unsigned char *)fb.bits, 0))
403 THROW("ERROR: Bogus data read back.");
404 fbx_term(&fb);
405 }
406 catch(...)
407 {
408 fbx_term(&fb); retCode = -1; throw;
409 }
410 }
411
412 private:
413

Callers 1

Thread.cppFile · 0.45

Calls 3

fbx_termFunction · 0.85
fbx_readFunction · 0.85
cmpBufFunction · 0.70

Tested by

no test coverage detected