Commit 81c28576 by Nicolas Capens

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/8933Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent d5401e26
......@@ -44,7 +44,7 @@ const bool strictConformance = false;
#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 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
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
......
......@@ -36,7 +36,6 @@ public:
EGLConfig getHandle() const;
const sw::Format mDisplayFormat;
const sw::Format mRenderTargetFormat;
const sw::Format mDepthStencilFormat;
const EGLint mMultiSample;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment