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

Function eglGetConfigAttrib

server/faker-egl.cpp:686–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684
685
686EGLBoolean eglGetConfigAttrib(EGLDisplay display, EGLConfig config,
687 EGLint attribute, EGLint *value)
688{
689 EGLBoolean retval = EGL_FALSE;
690
691 TRY();
692
693 if(IS_EXCLUDED_EGLX(display))
694 return _eglGetConfigAttrib(display, config, attribute, value);
695
696 GET_DISPLAY_INIT(EGL_NOT_INITIALIZED);
697 DISABLE_FAKER();
698
699 /////////////////////////////////////////////////////////////////////////////
700 OPENTRACE(eglGetConfigAttrib); PRARGX(display); PRARGEC(eglxdpy, config);
701 PRARGX(attribute); STARTTRACE();
702 /////////////////////////////////////////////////////////////////////////////
703
704 if(config && value)
705 {
706 XVisualInfo *v = getVisualFromConfig(eglxdpy, config);
707
708 if(attribute == EGL_NATIVE_RENDERABLE)
709 {
710 *value = v ? EGL_TRUE : EGL_FALSE;
711 retval = EGL_TRUE;
712 }
713 else if(attribute == EGL_NATIVE_VISUAL_ID)
714 {
715 *value = v ? v->visualid : 0;
716 retval = EGL_TRUE;
717 }
718 else if(attribute == EGL_NATIVE_VISUAL_TYPE)
719 {
720 *value = v ? TrueColor : 0;
721 retval = EGL_TRUE;
722 }
723 if(v) _XFree(v);
724 }
725
726 if(!retval)
727 retval = _eglGetConfigAttrib(display, config, attribute, value);
728
729 if(value && attribute == EGL_SURFACE_TYPE && *value & EGL_PBUFFER_BIT)
730 {
731 *value |= EGL_WINDOW_BIT;
732 *value &= ~(EGL_SWAP_BEHAVIOR_PRESERVED_BIT | EGL_PIXMAP_BIT);
733 }
734
735 /////////////////////////////////////////////////////////////////////////////
736 STOPTRACE(); if(value) { PRARGIX(*value); } else { PRARGX(value); }
737 PRARGI(retval); CLOSETRACE();
738 /////////////////////////////////////////////////////////////////////////////
739
740 CATCH();
741 ENABLE_FAKER();
742 bailout:
743 return retval;

Callers 3

getVisualFromConfigFunction · 0.85
mainFunction · 0.85
get_config_attribsFunction · 0.85

Calls 1

getVisualFromConfigFunction · 0.70

Tested by

no test coverage detected