Make Framebuffer::Data members private.
This makes "Data" a proper class, and enforces access control when
used in FramebufferImpl. This gives a cleaner refactor when we
switch the internals of the class to use value types to store
attachments instead of pointer types.
BUG=angleproject:963
Change-Id: If825095458eaf9367f616f0bb54084025efb9882
Reviewed-on: https://chromium-review.googlesource.com/265937
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/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 6aaf698..3008c05 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -415,7 +415,7 @@
return true;
}
-static bool IsPartialBlit(gl::Context *context, gl::FramebufferAttachment *readBuffer, gl::FramebufferAttachment *writeBuffer,
+static bool IsPartialBlit(gl::Context *context, const gl::FramebufferAttachment *readBuffer, const gl::FramebufferAttachment *writeBuffer,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1)
{
@@ -529,8 +529,8 @@
if (mask & GL_COLOR_BUFFER_BIT)
{
- gl::FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
- gl::FramebufferAttachment *drawColorBuffer = drawFramebuffer->getFirstColorbuffer();
+ const gl::FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
+ const gl::FramebufferAttachment *drawColorBuffer = drawFramebuffer->getFirstColorbuffer();
if (readColorBuffer && drawColorBuffer)
{
@@ -583,7 +583,7 @@
if (fromAngleExtension)
{
- FramebufferAttachment *readColorAttachment = readFramebuffer->getReadColorbuffer();
+ const FramebufferAttachment *readColorAttachment = readFramebuffer->getReadColorbuffer();
if (!readColorAttachment ||
(!(readColorAttachment->type() == GL_TEXTURE && readColorAttachment->getTextureImageIndex().type == GL_TEXTURE_2D) &&
readColorAttachment->type() != GL_RENDERBUFFER &&
@@ -1174,7 +1174,7 @@
return false;
}
- FramebufferAttachment *attachment = framebuffer->getReadColorbuffer();
+ const FramebufferAttachment *attachment = framebuffer->getReadColorbuffer();
if (!attachment)
{
context->recordError(Error(GL_INVALID_OPERATION));