hwc: Do solidFill for each region instead of union of all

In cases where we need to clear multiple regions we are
sending union of those regions in single call. Instead calling
clear for independent clear regions will help in achieving
performance gain by reducing time taken for solidFill.

Change-Id: I5dbd3532692042e7d408edd2d73193e68384af70
diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp
index 00bd643..ae7431f 100644
--- a/libhwcomposer/hwc_copybit.cpp
+++ b/libhwcomposer/hwc_copybit.cpp
@@ -567,19 +567,11 @@
     mDirtyRect = list->hwLayers[last].displayFrame;
 
     if (mDirtyLayerIndex != NO_UPDATING_LAYER &&
-            CBUtils::getuiClearRegion(list, clearRegion, layerProp,
-                                                    mDirtyLayerIndex)) {
-       int clear_w =  clearRegion.right -  clearRegion.left;
-       int clear_h =  clearRegion.bottom - clearRegion.top;
-       //mdp can't handle solid fill for one line
-       //making solid fill as full in this case
-       //disable swap rect if presents
-       if ((clear_w == 1) || (clear_h ==1)) {
-           clear(renderBuffer, mDirtyRect);
-           mDirtyLayerIndex = -1;
-       }else
-           clear(renderBuffer, clearRegion);
+           not CBUtils::uiClearRegion(list, ctx->mMDP.version, layerProp,
+                                   mDirtyLayerIndex, mEngine, renderBuffer)){
+        mDirtyLayerIndex = -1;
     }
+
     if (mDirtyLayerIndex != -1) {
         if (mDirtyLayerIndex == NO_UPDATING_LAYER) {
             mDirtyRect = clearRegion;
@@ -648,10 +640,9 @@
     }
 
     //Clear the transparent or left out region on the render buffer
-    hwc_rect_t clearRegion = {0,0,0,0};
     LayerProp *layerProp = ctx->layerProp[0];
-    if(CBUtils::getuiClearRegion(list, clearRegion, layerProp))
-        clear(renderBuffer, clearRegion);
+    CBUtils::uiClearRegion(list, ctx->mMDP.version, layerProp, -1,
+                                                    mEngine, renderBuffer);
 
     int copybitLayerCount = 0;
     for(int j = 0; j < ptorInfo->count; j++) {