Share FBO state with object and Impl.
This patch introduces a new Framebuffer::Data class, which stores
attachment related state. This will eliminate the need to store
duplicated state between the classes.
BUG=angleproject:930
Change-Id: I80de4db39ab99d623b0ad8306bf3cbb794cd8bd5
Reviewed-on: https://chromium-review.googlesource.com/254100
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 8566325..a37d8b3 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -184,10 +184,8 @@
mHasBeenCurrent = true;
}
- Framebuffer *framebufferZero = new DefaultFramebuffer(mRenderer->createFramebuffer(),
- mRenderer->createDefaultAttachment(GL_BACK, surface),
- mRenderer->createDefaultAttachment(GL_DEPTH, surface),
- mRenderer->createDefaultAttachment(GL_STENCIL, surface));
+ // TODO(jmadill): do not allocate new pointers here
+ Framebuffer *framebufferZero = new DefaultFramebuffer(mCaps, mRenderer, surface);
setFramebufferZero(framebufferZero);
@@ -523,7 +521,7 @@
{
if (!getFramebuffer(framebuffer))
{
- mFramebufferMap[framebuffer] = new Framebuffer(mRenderer->createFramebuffer(), framebuffer);
+ mFramebufferMap[framebuffer] = new Framebuffer(mCaps, mRenderer, framebuffer);
}
mState.setReadFramebufferBinding(getFramebuffer(framebuffer));
@@ -533,7 +531,7 @@
{
if (!getFramebuffer(framebuffer))
{
- mFramebufferMap[framebuffer] = new Framebuffer(mRenderer->createFramebuffer(), framebuffer);
+ mFramebufferMap[framebuffer] = new Framebuffer(mCaps, mRenderer, framebuffer);
}
mState.setDrawFramebufferBinding(getFramebuffer(framebuffer));