drm_hwcomposer: cache the framebuffers given to the GLWorker

This saves some work in EGL/GL that would normally get repeated every frame.
Because the same framebuffers are generally used every frame, this CL adds a
cache containing all the EGL/GL objects that correspond to the given
GraphicBuffer. The cache initially holds a strong reference while rendering,
but once glFinish is called, only a weak reference is held until rendering
to that same GraphicBuffer starts again. The weak reference is used to check
if that GraphicBuffer has been destroyed, which means the corresponding EGL/GL
resources should be destroyed.

The cache can be disabled with the following command:
$ adb shell setprop hwc.drm.use_framebuffer_cache 0

Change-Id: Iddee1efc5bad67f6c4479e7f402354e229c3b0a2
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 7259d07..9130085 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -184,8 +184,9 @@
     }
   }
 
-  ret = pre_compositor_->CompositeAndFinish(
-      pre_comp_layers.data(), pre_comp_layers.size(), fb.buffer());
+  ret = pre_compositor_->Composite(pre_comp_layers.data(),
+                                   pre_comp_layers.size(), fb.buffer());
+  pre_compositor_->Finish();
 
   for (auto &pre_comp_layer : pre_comp_layers) {
     if (pre_comp_layer.acquireFenceFd >= 0) {