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

Function RRTransGetFrame

server/testplugin2.cpp:91–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91RRFrame *RRTransGetFrame(void *handle, int width, int height, int format,
92 int stereo)
93{
94 _vgl_disableFaker();
95
96 RRFrame *frame = NULL;
97 try
98 {
99 X11Trans *trans = (X11Trans *)handle;
100 if(!trans) THROW("Invalid handle");
101 frame = new RRFrame;
102 memset(frame, 0, sizeof(RRFrame));
103 FBXFrame *f = trans->getFrame(dpy, win, width, height);
104 f->flags |= FRAME_BOTTOMUP;
105 frame->opaque = (void *)f;
106 frame->w = f->hdr.framew;
107 frame->h = f->hdr.frameh;
108 frame->pitch = f->pitch;
109 frame->bits = f->bits;
110 frame->format = pf2trans[f->pf->id];
111 if(frame->format < 0) THROW("Unsupported pixel format");
112 }
113 catch(std::exception &e)
114 {
115 snprintf(errStr, MAXSTR + 14, "Error in %s -- %s", GET_METHOD(e),
116 e.what());
117 delete frame;
118 frame = NULL;
119 }
120
121 _vgl_enableFaker();
122
123 return frame;
124}
125
126
127int RRTransReady(void *handle)

Callers

nothing calls this directly

Calls 4

whatMethod · 0.80
_vgl_disableFakerFunction · 0.70
_vgl_enableFakerFunction · 0.70
getFrameMethod · 0.45

Tested by

no test coverage detected