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/ProgramImpl.h b/src/libANGLE/renderer/ProgramImpl.h
index f7b7fbe..5733e79 100644
--- a/src/libANGLE/renderer/ProgramImpl.h
+++ b/src/libANGLE/renderer/ProgramImpl.h
@@ -33,13 +33,12 @@
using LinkResult = gl::ErrorOrResult<bool>;
-class ContextImpl;
-
class ProgramImpl : angle::NonCopyable
{
public:
ProgramImpl(const gl::ProgramState &state) : mState(state) {}
virtual ~ProgramImpl() {}
+ virtual void destroy(const ContextImpl *contextImpl) {}
virtual LinkResult load(const ContextImpl *contextImpl,
gl::InfoLog &infoLog,