Querying GLCapabilities from native configuration currently explodes into multiple xxxGetConfig(..) JNI calls, which utilize NIO buffers. Using a bulk method will enhance performance. Further more, add a 'fast path' where we use the recommended native config as chosen by xxxChooseConfig(..), i.e. only create the chosen GLCapabilities which is being used, instead of querying all GLCapabilities! This will speed-up the process dramatically.
613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(..) ran over all FB configs and for each it grabbed native config values separately. Fetching them in bulk mode saves around 7% of this function's cost. Also reuse XRenderPictFormat instance for 'XRenderDirectFormat XRenderFindVisualFormat(..)' call, saving a few NIO creation cycles w/ StructAccessor. Biggest savior is X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig()'s fast path w/o chooser and usable 1st FBConfig. Here we only issue 'GLXFBConfig2GLCapabilities(..)' on the first valid entry. Test w/ 50 X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig() invocations: - pre change: 1.708 ms - post change: 650 ms Time is no spent almost solely on native glXChooseFBConfig (546ms).
cf1163fc88976e7087d3a17524a49139e35a4708 Bug 888 / Bug 891 - Enhance GLCapabilities-Query: Apply changes of commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d to EGL and WGL.
6395670886513796b747e7aaef2ebfbbcda7b07e: WindowsWGLGraphicsConfigurationFactory: Fix chosenPFDID -> recommendedIndex (!skipCapsChooser mode) Regression of commit cf1163fc88976e7087d3a17524a49139e35a4708: Commit dropped seeking recommendedIndex of chosenPFDID within cleaned-up availableCaps when in !skipCapsChooser mode.
144b9ef5a433b2a93f5503b1c935c8f7ec61a0de GLJPanel: Don't ctor DefaultGLCapabilitiesChooser() if null chooser is passed, this allows native GLCaps/config query to follow fast-path