Add destroy hooks for several GL objects.
These hooks allow the back-end renderer to free object resources
without having to store pointers to shared device handles for
each and every object. This will allow us to save memory on
back-ends that really care about memory overhead.
There is a downside in that there is more boilerplate in passing
gl::Context handles around everywhere.
BUG=angleproject:1684
Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7
Reviewed-on: https://chromium-review.googlesource.com/426401
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/FramebufferImpl.h b/src/libANGLE/renderer/FramebufferImpl.h
index 3bbab71..dceef5f 100644
--- a/src/libANGLE/renderer/FramebufferImpl.h
+++ b/src/libANGLE/renderer/FramebufferImpl.h
@@ -24,12 +24,15 @@
namespace rx
{
+class DisplayImpl;
class FramebufferImpl : angle::NonCopyable
{
public:
explicit FramebufferImpl(const gl::FramebufferState &state) : mState(state) {}
virtual ~FramebufferImpl() { }
+ virtual void destroy(ContextImpl *contextImpl) {}
+ virtual void destroyDefault(DisplayImpl *displayImpl) {}
virtual gl::Error discard(size_t count, const GLenum *attachments) = 0;
virtual gl::Error invalidate(size_t count, const GLenum *attachments) = 0;