Use Context caps in Framebuffer completeness check.
This frees the Framebuffer from any dependency on the Renderer.
BUG=angle:789
Change-Id: I0e9ae0edf93674e32ae4f6538a934cddbdc804d5
Reviewed-on: https://chromium-review.googlesource.com/225470
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index f9b3d3b..49ba73e 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -203,7 +203,7 @@
rx::RenderbufferImpl *colorbufferZero = mRenderer->createRenderbuffer(swapchain, false);
rx::RenderbufferImpl *depthStencilbufferZero = mRenderer->createRenderbuffer(swapchain, true);
- Framebuffer *framebufferZero = new DefaultFramebuffer(mRenderer, colorbufferZero, depthStencilbufferZero);
+ Framebuffer *framebufferZero = new DefaultFramebuffer(colorbufferZero, depthStencilbufferZero);
setFramebufferZero(framebufferZero);
@@ -540,7 +540,7 @@
{
if (!getFramebuffer(framebuffer))
{
- mFramebufferMap[framebuffer] = new Framebuffer(mRenderer, framebuffer);
+ mFramebufferMap[framebuffer] = new Framebuffer(framebuffer);
}
mState.setReadFramebufferBinding(getFramebuffer(framebuffer));
@@ -550,7 +550,7 @@
{
if (!getFramebuffer(framebuffer))
{
- mFramebufferMap[framebuffer] = new Framebuffer(mRenderer, framebuffer);
+ mFramebufferMap[framebuffer] = new Framebuffer(framebuffer);
}
mState.setDrawFramebufferBinding(getFramebuffer(framebuffer));
@@ -953,7 +953,7 @@
*params = static_cast<GLint>(mExtensionStrings.size());
break;
default:
- mState.getIntegerv(pname, params);
+ mState.getIntegerv(getData(), pname, params);
break;
}
}
@@ -1305,7 +1305,7 @@
Error Context::applyRenderTarget(GLenum drawMode, bool ignoreViewport)
{
Framebuffer *framebufferObject = mState.getDrawFramebuffer();
- ASSERT(framebufferObject && framebufferObject->completeness() == GL_FRAMEBUFFER_COMPLETE);
+ ASSERT(framebufferObject && framebufferObject->completeness(getData()) == GL_FRAMEBUFFER_COMPLETE);
gl::Error error = mRenderer->applyRenderTarget(framebufferObject);
if (error.isError())
@@ -1327,7 +1327,7 @@
Error Context::applyState(GLenum drawMode)
{
Framebuffer *framebufferObject = mState.getDrawFramebuffer();
- int samples = framebufferObject->getSamples();
+ int samples = framebufferObject->getSamples(getData());
RasterizerState rasterizer = mState.getRasterizerState();
rasterizer.pointDrawMode = (drawMode == GL_POINTS);
@@ -1980,7 +1980,7 @@
void Context::getCurrentReadFormatType(GLenum *internalFormat, GLenum *format, GLenum *type)
{
Framebuffer *framebuffer = mState.getReadFramebuffer();
- ASSERT(framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE);
+ ASSERT(framebuffer && framebuffer->completeness(getData()) == GL_FRAMEBUFFER_COMPLETE);
FramebufferAttachment *attachment = framebuffer->getReadColorbuffer();
ASSERT(attachment);