Default to libGLESv2 for EGL surface buffer creation. If both libGLES_CM and libGLESv2 are available, we were using the former for creating the buffers of an EGL surface. The choice is arbitrary, but it causes confusing issues when an interface changes and one of the libraries wasn't rebuilt. This is less likely to occur for libGLESv2. Change-Id: If0c05d50a141c3782866892694d238332d8211db Reviewed-on: https://swiftshader-review.googlesource.com/13388 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/libEGL/Surface.cpp b/src/OpenGL/libEGL/Surface.cpp index b3616b1..4e05d5a 100644 --- a/src/OpenGL/libEGL/Surface.cpp +++ b/src/OpenGL/libEGL/Surface.cpp
@@ -76,14 +76,14 @@ { ASSERT(!backBuffer && !depthStencil); - if(libGLES_CM) - { - backBuffer = libGLES_CM->createBackBuffer(width, height, config->mRenderTargetFormat, config->mSamples); - } - else if(libGLESv2) + if(libGLESv2) { backBuffer = libGLESv2->createBackBuffer(width, height, config->mRenderTargetFormat, config->mSamples); } + else if(libGLES_CM) + { + backBuffer = libGLES_CM->createBackBuffer(width, height, config->mRenderTargetFormat, config->mSamples); + } if(!backBuffer) { @@ -94,14 +94,14 @@ if(config->mDepthStencilFormat != sw::FORMAT_NULL) { - if(libGLES_CM) - { - depthStencil = libGLES_CM->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples); - } - else if(libGLESv2) + if(libGLESv2) { depthStencil = libGLESv2->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples); } + else if(libGLES_CM) + { + depthStencil = libGLES_CM->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples); + } if(!depthStencil) { @@ -332,14 +332,14 @@ if(window) { - if(libGLES_CM) - { - frameBuffer = libGLES_CM->createFrameBuffer(display->getNativeDisplay(), window, width, height); - } - else if(libGLESv2) + if(libGLESv2) { frameBuffer = libGLESv2->createFrameBuffer(display->getNativeDisplay(), window, width, height); } + else if(libGLES_CM) + { + frameBuffer = libGLES_CM->createFrameBuffer(display->getNativeDisplay(), window, width, height); + } if(!frameBuffer) {