| 110 | |
| 111 | |
| 112 | FBXFrame *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 | |
| 140 | bool X11Trans::isReady(void) |
nothing calls this directly
no test coverage detected