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

Function eglMakeCurrent

server/faker-egl.cpp:1154–1231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152
1153
1154EGLBoolean eglMakeCurrent(EGLDisplay display, EGLSurface draw, EGLSurface read,
1155 EGLContext context)
1156{
1157 EGLBoolean retval = EGL_FALSE;
1158 EGLSurface actualDraw = draw, actualRead = read;
1159
1160 TRY();
1161
1162 if(IS_EXCLUDED_EGLX(display))
1163 {
1164 faker::setEGLExcludeCurrent(true);
1165 faker::setOGLExcludeCurrent(true);
1166 faker::setEGLXContextCurrent(false);
1167 faker::setCurrentEGLXDisplay(NULL);
1168 return _eglMakeCurrent(display, draw, read, context);
1169 }
1170 faker::setEGLExcludeCurrent(false);
1171 faker::setOGLExcludeCurrent(false);
1172
1173 GET_DISPLAY()
1174 if(!eglxdpy->isInit && context)
1175 {
1176 faker::setEGLError(EGL_NOT_INITIALIZED); goto bailout; \
1177 }
1178 DISABLE_FAKER();
1179
1180 /////////////////////////////////////////////////////////////////////////////
1181 OPENTRACE(eglMakeCurrent); PRARGX(display); PRARGX(draw); PRARGX(read);
1182 PRARGX(context); STARTTRACE();
1183 /////////////////////////////////////////////////////////////////////////////
1184
1185 faker::EGLXVirtualWin *drawEGLXVW = EGLXWINHASH.find(eglxdpy, draw);
1186 if(drawEGLXVW)
1187 {
1188 actualDraw = (EGLSurface)drawEGLXVW->updateGLXDrawable();
1189 setWMAtom(drawEGLXVW->getX11Display(), drawEGLXVW->getX11Drawable(),
1190 drawEGLXVW);
1191 }
1192 faker::EGLXVirtualWin *readEGLXVW = EGLXWINHASH.find(eglxdpy, read);
1193 if(readEGLXVW)
1194 {
1195 actualRead = (EGLSurface)readEGLXVW->updateGLXDrawable();
1196 if(readEGLXVW != drawEGLXVW)
1197 setWMAtom(readEGLXVW->getX11Display(), readEGLXVW->getX11Drawable(),
1198 readEGLXVW);
1199 }
1200 retval = _eglMakeCurrent(display, actualDraw, actualRead, context);
1201
1202 if((drawEGLXVW = EGLXWINHASH.findInternal(eglxdpy, actualDraw)) != NULL)
1203 {
1204 drawEGLXVW->clear(); drawEGLXVW->cleanup();
1205 }
1206 if((readEGLXVW = EGLXWINHASH.findInternal(eglxdpy, actualRead)) != NULL)
1207 readEGLXVW->cleanup();
1208
1209 if(context && retval)
1210 {
1211 // Disable the OpenGL interposer

Callers 5

readbackTestFunction · 0.85
runMethod · 0.85
offScreenTestFunction · 0.85
extensionQueryTestFunction · 0.85
print_display_infoFunction · 0.85

Calls 8

setWMAtomFunction · 0.85
getX11DrawableMethod · 0.80
findInternalMethod · 0.80
cleanupMethod · 0.80
findMethod · 0.45
updateGLXDrawableMethod · 0.45
getX11DisplayMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected