Pass gl::Context to impl methods instead of ContextImpl.
In some cases we might have to call back into the GL layer, passing
the Context, and if we just have a ContextImpl pointer this isn't
possible. It also removes the need for SafeGetImpl.
BUG=angleproject:2044
Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6
Reviewed-on: https://chromium-review.googlesource.com/516835
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 86653f6..20ce293 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -9,6 +9,7 @@
#include "libANGLE/renderer/d3d/FramebufferD3D.h"
#include "common/bitset_utils.h"
+#include "libANGLE/Context.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/Surface.h"
@@ -95,13 +96,13 @@
{
}
-gl::Error FramebufferD3D::clear(ContextImpl *context, GLbitfield mask)
+gl::Error FramebufferD3D::clear(const gl::Context *context, GLbitfield mask)
{
ClearParameters clearParams = GetClearParameters(context->getGLState(), mask);
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferfv(ContextImpl *context,
+gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context,
GLenum buffer,
GLint drawbuffer,
const GLfloat *values)
@@ -128,7 +129,7 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferuiv(ContextImpl *context,
+gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context,
GLenum buffer,
GLint drawbuffer,
const GLuint *values)
@@ -145,7 +146,7 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferiv(ContextImpl *context,
+gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context,
GLenum buffer,
GLint drawbuffer,
const GLint *values)
@@ -172,7 +173,7 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferfi(ContextImpl *context,
+gl::Error FramebufferD3D::clearBufferfi(const gl::Context *context,
GLenum buffer,
GLint drawbuffer,
GLfloat depth,
@@ -234,7 +235,7 @@
return implementationFormatInfo.getReadPixelsType();
}
-gl::Error FramebufferD3D::readPixels(ContextImpl *context,
+gl::Error FramebufferD3D::readPixels(const gl::Context *context,
const gl::Rectangle &area,
GLenum format,
GLenum type,
@@ -256,7 +257,7 @@
reinterpret_cast<uint8_t *>(pixels) + outputSkipBytes);
}
-gl::Error FramebufferD3D::blit(ContextImpl *context,
+gl::Error FramebufferD3D::blit(const gl::Context *context,
const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea,
GLbitfield mask,
@@ -297,7 +298,7 @@
return true;
}
-void FramebufferD3D::syncState(ContextImpl *contextImpl,
+void FramebufferD3D::syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits)
{
bool invalidateColorAttachmentCache = false;