robolectric / robolectric

Android Unit Testing Framework
http://robolectric.org
Other
5.81k stars 1.36k forks source link

Allow the configs parameter for eglChooseConfig to be null in shadow #9065

Closed copybara-service[bot] closed 3 weeks ago

copybara-service[bot] commented 3 weeks ago

Allow the configs parameter for eglChooseConfig to be null in shadow

Most of the time, the output parameters for EGL methods are expected to be non-null. But the configs parameter of eglChooseConfig is one of the exceptions. When configs is not null, eglChooseConfig fills that with the first configSize configs and fills numConfig with the number of returned configs (no more than configsSize). But when configs is_ null it fills numConfigs with the number of matching configs, ignoring configsSize: https://registry.khronos.org/EGL/sdk/docs/man/html/eglChooseConfig.xhtml

The Android code wrapping this API checks that attrib_list and num_configs output arrays are not null, but allows configs to be null (see frameworks/base/core/jni/android_opengl_EGL14.cpp).