Proliferate gl::Context everywhere.
This gives the D3D back-end access to the GL state almost anywhere.
This uses the onDestroy hook for Textures to push errors up from
destructors, although they still don't quite make it to the Context.
There are places, such as in EGL object (Context/Surface) destruction,
where we end up calling through to GL implementation internals without
having access to a gl::Context. We handle this via a proxy Context
to a Display, basically a null context, that has access to impl-side
state like the Renderer pointer if necessary. It does not have access
to the normal GL state.
Also Pass gl::Context to RefCountObject::release(). Since we're using
destroy() methods now, we should not ever call the destructor directly.
BUG=angleproject:1156
Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259
Reviewed-on: https://chromium-review.googlesource.com/529707
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 55a49d6..6975b05 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -189,7 +189,7 @@
return clearImpl(context, clearParams);
}
-GLenum FramebufferD3D::getImplementationColorReadFormat() const
+GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *context) const
{
const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment();
@@ -199,7 +199,7 @@
}
RenderTargetD3D *attachmentRenderTarget = nullptr;
- gl::Error error = readAttachment->getRenderTarget(&attachmentRenderTarget);
+ gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError())
{
return GL_NONE;
@@ -212,7 +212,7 @@
return implementationFormatInfo.getReadPixelsFormat();
}
-GLenum FramebufferD3D::getImplementationColorReadType() const
+GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context) const
{
const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment();
@@ -222,7 +222,7 @@
}
RenderTargetD3D *attachmentRenderTarget = nullptr;
- gl::Error error = readAttachment->getRenderTarget(&attachmentRenderTarget);
+ gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError())
{
return GL_NONE;
@@ -253,7 +253,7 @@
ANGLE_TRY_RESULT(sizedFormatInfo.computeSkipBytes(outputPitch, 0, packState, false),
outputSkipBytes);
- return readPixelsImpl(area, format, type, outputPitch, packState,
+ return readPixelsImpl(context, area, format, type, outputPitch, packState,
reinterpret_cast<uint8_t *>(pixels) + outputSkipBytes);
}