Clarify when we set the EGL_FRAMEBUFFER_TARGET_ANDROID attribute.

The EGL_ANDROID_framebuffer_target extension description is vague about
which configs are supposed to have the EGL_FRAMEBUFFER_TARGET_ANDROID
attribute set. The HWComposer isn't supposed to do format conversions,
nor should we have to blit or convert on eglSwapBuffers, so the flag
is only set when the config's format matches the framebuffer format.

Bug b/21804123

Change-Id: Ie348750fbf1b2f096cdf36358d5c90b6f42e30c1
Reviewed-on: https://swiftshader-review.googlesource.com/8933
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libEGL/Config.cpp b/src/OpenGL/libEGL/Config.cpp
index 43ca44d..a1c800b 100644
--- a/src/OpenGL/libEGL/Config.cpp
+++ b/src/OpenGL/libEGL/Config.cpp
@@ -44,7 +44,7 @@
 #endif
 
 Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, sw::Format renderTargetFormat, sw::Format depthStencilFormat, EGLint multiSample, bool conformant)
-	: mDisplayFormat(displayFormat), mRenderTargetFormat(renderTargetFormat), mDepthStencilFormat(depthStencilFormat), mMultiSample(multiSample)
+	: mRenderTargetFormat(renderTargetFormat), mDepthStencilFormat(depthStencilFormat), mMultiSample(multiSample)
 {
 	mBindToTextureRGB = EGL_FALSE;
 	mBindToTextureRGBA = EGL_FALSE;
@@ -195,8 +195,10 @@
 	mTransparentGreenValue = 0;
 	mTransparentBlueValue = 0;
 
-	mRecordableAndroid = EGL_TRUE;
+	// Although we could support any format as an Android HWComposer compatible config by converting when necessary,
+	// the intent of EGL_ANDROID_framebuffer_target is to prevent any copies or conversions.
 	mFramebufferTargetAndroid = (displayFormat == renderTargetFormat) ? EGL_TRUE : EGL_FALSE;
+	mRecordableAndroid = EGL_TRUE;
 }
 
 EGLConfig Config::getHandle() const
diff --git a/src/OpenGL/libEGL/Config.h b/src/OpenGL/libEGL/Config.h
index 9b47ac7..a15fbd1 100644
--- a/src/OpenGL/libEGL/Config.h
+++ b/src/OpenGL/libEGL/Config.h
@@ -36,7 +36,6 @@
 
 	EGLConfig getHandle() const;
 
-	const sw::Format mDisplayFormat;
 	const sw::Format mRenderTargetFormat;
 	const sw::Format mDepthStencilFormat;
 	const EGLint mMultiSample;