Add support for multiple render targets in glClear.

TRAC #22659

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2081 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Framebuffer.cpp b/src/libGLESv2/Framebuffer.cpp
index e10ff58..98a38b1 100644
--- a/src/libGLESv2/Framebuffer.cpp
+++ b/src/libGLESv2/Framebuffer.cpp
@@ -264,6 +264,24 @@
     mDrawBufferStates[colorAttachment] = drawBuffer;
 }
 
+bool Framebuffer::isEnabledColorAttachment(unsigned int colorAttachment) const
+{
+    return (mColorbufferTypes[colorAttachment] != GL_NONE && mDrawBufferStates[colorAttachment] != GL_NONE);
+}
+
+bool Framebuffer::hasEnabledColorAttachment() const
+{
+    for (unsigned int colorAttachment = 0; colorAttachment < gl::IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++)
+    {
+        if (isEnabledColorAttachment(colorAttachment))
+        {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 bool Framebuffer::hasStencil() const
 {
     if (mStencilbufferType != GL_NONE)