hwc: Do not show animation on External display.

- When primary is animating, the animation should not be
  shown on the external display.
- Mark all app layers as HWC_OVERLAY on external during
  animation so that SF wont compose it on FB.

Change-Id: Ic557cabfd9f2518614777c0e993541e36e090850
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index b9be4d4..42d0741 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -111,8 +111,13 @@
             orient = static_cast<ovutils::eTransform >(ctx->mExtOrientation);
         }
 
+        // Do not use getNonWormholeRegion() function to calculate the
+        // sourceCrop during animation on external display and
         // Dont do wormhole calculation when extorientation is set on External
-        if((!mDpy || (mDpy && !ctx->mExtOrientation))
+        if(ctx->listStats[mDpy].isDisplayAnimating && mDpy) {
+            sourceCrop = layer->displayFrame;
+            displayFrame = sourceCrop;
+        } else if((!mDpy || (mDpy && !ctx->mExtOrientation))
                                && extOnlyLayerIndex == -1) {
             getNonWormholeRegion(list, sourceCrop);
             displayFrame = sourceCrop;
@@ -266,7 +271,12 @@
 
         hwc_rect_t sourceCrop = layer->sourceCrop;
         hwc_rect_t displayFrame = layer->displayFrame;
-        if(extOnlyLayerIndex == -1) {
+        // Do not use getNonWormholeRegion() function to calculate the
+        // sourceCrop during animation on external display.
+        if(ctx->listStats[mDpy].isDisplayAnimating && mDpy) {
+            sourceCrop = layer->displayFrame;
+            displayFrame = sourceCrop;
+        } else if(extOnlyLayerIndex == -1) {
             getNonWormholeRegion(list, sourceCrop);
             displayFrame = sourceCrop;
         }