drm_hwcomposer: make the gl worker compositor not nested

Change-Id: I06b75644408a570044499a9f603a478f3199661f
diff --git a/glworker.h b/glworker.h
index 4ac0e7d..e9febec 100644
--- a/glworker.h
+++ b/glworker.h
@@ -30,6 +30,8 @@
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 
+#include <ui/GraphicBuffer.h>
+
 struct hwc_layer_1;
 
 namespace android {
@@ -77,6 +79,24 @@
   }
 };
 
+class GLWorkerCompositor {
+ public:
+  GLWorkerCompositor();
+  ~GLWorkerCompositor();
+
+  int Init();
+
+  int Composite(hwc_layer_1 *layers, size_t num_layers,
+                sp<GraphicBuffer> framebuffer);
+
+ private:
+  EGLDisplay egl_display_;
+  EGLContext egl_ctx_;
+
+  std::vector<AutoGLProgram> blend_programs_;
+  AutoGLBuffer vertex_buffer_;
+};
+
 class GLWorker {
  public:
   struct Work {
@@ -89,24 +109,6 @@
     Work(const Work &rhs) = delete;
   };
 
-  class Compositor {
-   public:
-    Compositor();
-    ~Compositor();
-
-    int Init();
-
-    int Composite(hwc_layer_1 *layers, size_t num_layers,
-                  sp<GraphicBuffer> framebuffer);
-
-   private:
-    EGLDisplay egl_display_;
-    EGLContext egl_ctx_;
-
-    std::vector<AutoGLProgram> blend_programs_;
-    AutoGLBuffer vertex_buffer_;
-  };
-
   GLWorker();
   ~GLWorker();
 
@@ -126,7 +128,7 @@
   int worker_ret_;
 
   void WorkerRoutine();
-  int DoComposition(Compositor &compositor, Work *work);
+  int DoComposition(GLWorkerCompositor &compositor, Work *work);
 
   int SignalWorker(Work *work, bool worker_exit);