hwc: hwc 1.1 implementation

Bug: 7124159

--External disabled
--MDP comp coded but disabled.
--Videos via overlay, so that secure videos can work.

Change-Id: Ie48b264143d5e4237ab9724e28930e3f68ba49ee
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc_video.h b/libhwcomposer/hwc_video.h
index ec8fa21..f5a9709 100644
--- a/libhwcomposer/hwc_video.h
+++ b/libhwcomposer/hwc_video.h
@@ -26,53 +26,29 @@
 class VideoOverlay {
 public:
     //Sets up members and prepares overlay if conditions are met
-    static bool prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list);
+    static bool prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
+            int dpy);
     //Draws layer if this feature is on
-    static bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list);
-    //Receives data from hwc
-    static void setStats(int yuvCount, int yuvLayerIndex, bool isYuvLayerSkip,
-            int ccLayerIndex);
+    static bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
+            int dpy);
     //resets values
     static void reset();
 private:
     //Choose an appropriate overlay state based on conditions
-    static void chooseState(hwc_context_t *ctx);
+    static void chooseState(hwc_context_t *ctx, int dpy,
+        hwc_layer_1_t *yuvLayer);
     //Configures overlay for video prim and ext
-    static bool configure(hwc_context_t *ctx, hwc_layer_1_t *yuvlayer,
-            hwc_layer_1_t *ccLayer);
+    static bool configure(hwc_context_t *ctx, int dpy,
+            hwc_layer_1_t *yuvlayer);
     //Marks layer flags if this feature is used
-    static void markFlags(hwc_layer_1_t *yuvLayer, hwc_layer_1_t *ccLayer);
-    //returns yuv count
-    static int getYuvCount();
-
+    static void markFlags(hwc_layer_1_t *yuvLayer);
     //The chosen overlay state.
     static ovutils::eOverlayState sState;
-    //Number of yuv layers in this drawing round
-    static int sYuvCount;
-    //Index of YUV layer, relevant only if count is 1
-    static int sYuvLayerIndex;
-    //Flags if a yuv layer is animating or below something that is animating
-    static bool sIsYuvLayerSkip;
-    //Holds the closed caption layer index, -1 by default
-    static int sCCLayerIndex;
     //Flags if this feature is on.
     static bool sIsModeOn;
 };
 
-inline void VideoOverlay::setStats(int yuvCount, int yuvLayerIndex,
-        bool isYuvLayerSkip, int ccLayerIndex) {
-    sYuvCount = yuvCount;
-    sYuvLayerIndex = yuvLayerIndex;
-    sIsYuvLayerSkip = isYuvLayerSkip;
-    sCCLayerIndex = ccLayerIndex;
-}
-
-inline int VideoOverlay::getYuvCount() { return sYuvCount; }
 inline void VideoOverlay::reset() {
-    sYuvCount = 0;
-    sYuvLayerIndex = -1;
-    sIsYuvLayerSkip = false;
-    sCCLayerIndex = -1;
     sIsModeOn = false;
     sState = ovutils::OV_CLOSED;
 }