Revert "Revert "Make the default framebuffer owned by Surface""
Reland the commit after fixing a bug in FramebufferAttachment.
This reverts commit 18fdcbcf1d02d3b3b4b5c712f05058f2e8d629c6.
BUG=angleproject:891
Change-Id: I07e08de52bfce8d84d070fc7bc15883009298a4d
Reviewed-on: https://chromium-review.googlesource.com/294831
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h
index 3b132a3..a22f317 100644
--- a/src/libANGLE/Framebuffer.h
+++ b/src/libANGLE/Framebuffer.h
@@ -23,6 +23,7 @@
class ImplFactory;
class FramebufferImpl;
class RenderbufferImpl;
+class SurfaceImpl;
}
namespace egl
@@ -50,13 +51,14 @@
class Data final : angle::NonCopyable
{
public:
+ explicit Data();
explicit Data(const Caps &caps);
~Data();
const FramebufferAttachment *getReadAttachment() const;
const FramebufferAttachment *getFirstColorAttachment() const;
const FramebufferAttachment *getDepthOrStencilAttachment() const;
- const FramebufferAttachment *getColorAttachment(unsigned int colorAttachment) const;
+ const FramebufferAttachment *getColorAttachment(size_t colorAttachment) const;
const FramebufferAttachment *getDepthAttachment() const;
const FramebufferAttachment *getStencilAttachment() const;
const FramebufferAttachment *getDepthStencilAttachment() const;
@@ -76,6 +78,7 @@
};
Framebuffer(const Caps &caps, rx::ImplFactory *factory, GLuint id);
+ Framebuffer(rx::SurfaceImpl *surface);
virtual ~Framebuffer();
const rx::FramebufferImpl *getImplementation() const { return mImpl; }
@@ -92,7 +95,7 @@
void detachTexture(GLuint texture);
void detachRenderbuffer(GLuint renderbuffer);
- const FramebufferAttachment *getColorbuffer(unsigned int colorAttachment) const;
+ const FramebufferAttachment *getColorbuffer(size_t colorAttachment) const;
const FramebufferAttachment *getDepthbuffer() const;
const FramebufferAttachment *getStencilbuffer() const;
const FramebufferAttachment *getDepthStencilBuffer() const;
@@ -109,8 +112,9 @@
GLenum getReadBufferState() const;
void setReadBuffer(GLenum buffer);
- bool isEnabledColorAttachment(unsigned int colorAttachment) const;
+ bool isEnabledColorAttachment(size_t colorAttachment) const;
bool hasEnabledColorAttachment() const;
+ size_t getNumColorBuffers() const;
bool hasStencil() const;
int getSamples(const gl::Data &data) const;
bool usingExtendedDrawBuffers() const;