Make the default framebuffer owned by Surface
In CGL there is no notion of default Framebuffer and MakeCurrent only
makes a context current but not a drawable. Instead, everything is done
via render to texture. For that reason, different surfaces will have
different FBOs as default framebuffers, which causes that change.
BUG=angleproject:891
Change-Id: I3f6da7b587353316026ea39a5c87f91265e0f1ba
Reviewed-on: https://chromium-review.googlesource.com/289872
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index a7804cf..de7fcd5 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -605,7 +605,7 @@
GLenum readInternalFormat = readColorBuffer->getInternalFormat();
const InternalFormat &readFormatInfo = GetInternalFormatInfo(readInternalFormat);
- for (GLuint i = 0; i < context->getCaps().maxColorAttachments; i++)
+ for (int i = 0; i < drawFramebuffer->getNumColorBuffers(); i++)
{
if (drawFramebuffer->isEnabledColorAttachment(i))
{
@@ -661,7 +661,8 @@
return false;
}
- for (GLuint colorAttachment = 0; colorAttachment < context->getCaps().maxColorAttachments; ++colorAttachment)
+ for (int colorAttachment = 0;
+ colorAttachment < drawFramebuffer->getNumColorBuffers(); ++colorAttachment)
{
if (drawFramebuffer->isEnabledColorAttachment(colorAttachment))
{