Add a callback for when a gl functor is released

Bug: 27709981

Change-Id: Id5be3e8f88d6d84a9c59c7ed23e7e8862feefbe8
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index 181b343..b572bda 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -73,6 +73,12 @@
         delete path;
     }
 
+    for (auto& iter : functors) {
+        if (iter.listener) {
+            iter.listener->onGlFunctorReleased(iter.functor);
+        }
+    }
+
     patchResources.clear();
     pathResources.clear();
     paints.clear();