Revert "Make the default framebuffer owned by Surface"
This reverts commit 87e63a9982803b5e4c12afa9a40ff0e2b04a7369.
Speculative revert to fix the webgl cts on Windows D3D9 and the
unittests on Linux.
BUG=
Change-Id: I488f4e0b2dc67270eed45f1c10bfba1d13c98739
Reviewed-on: https://chromium-review.googlesource.com/293350
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index b657d1e..398c980 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -20,7 +20,6 @@
#include "libANGLE/renderer/FramebufferImpl.h"
#include "libANGLE/renderer/ImplFactory.h"
#include "libANGLE/renderer/RenderbufferImpl.h"
-#include "libANGLE/renderer/SurfaceImpl.h"
namespace gl
{
@@ -38,14 +37,6 @@
}
}
-Framebuffer::Data::Data()
- : mColorAttachments(1),
- mDrawBufferStates(1, GL_NONE),
- mReadBufferState(GL_COLOR_ATTACHMENT0_EXT)
-{
- mDrawBufferStates[0] = GL_COLOR_ATTACHMENT0_EXT;
-}
-
Framebuffer::Data::Data(const Caps &caps)
: mColorAttachments(caps.maxColorAttachments),
mDrawBufferStates(caps.maxDrawBuffers, GL_NONE),
@@ -125,15 +116,18 @@
}
Framebuffer::Framebuffer(const Caps &caps, rx::ImplFactory *factory, GLuint id)
- : mData(caps), mImpl(factory->createFramebuffer(mData)), mId(id)
+ : mData(caps),
+ mImpl(nullptr),
+ mId(id)
{
- ASSERT(mId != 0);
- ASSERT(mImpl != nullptr);
-}
-
-Framebuffer::Framebuffer(rx::SurfaceImpl *surface)
- : mData(), mImpl(surface->createDefaultFramebuffer(mData)), mId(0)
-{
+ if (mId == 0)
+ {
+ mImpl = factory->createDefaultFramebuffer(mData);
+ }
+ else
+ {
+ mImpl = factory->createFramebuffer(mData);
+ }
ASSERT(mImpl != nullptr);
}
@@ -283,11 +277,6 @@
return false;
}
-int Framebuffer::getNumColorBuffers() const
-{
- return mData.mColorAttachments.size();
-}
-
bool Framebuffer::hasStencil() const
{
return (mData.mStencilAttachment.isAttached() && mData.mStencilAttachment.getStencilSize() > 0);