[Rounded Corner] Handle ContainerLayer correctly.

Previously we always use the source bounds of the child layer, this is correct
until two layers overlapped and form the hierachical structure. In this case we
need to use the source bounds of the parent, however, source bounds on
ContainerLayer usually doesn't make sense, in that case we need to use the
child source bounds.

BUG: b/125916918, b/129062310
Test: Test: Build, flash and boot. Verify with window transition for Youtube and Chrome.
Change-Id: Ida45a0d5b7723a7977806d5dbd0c928844009efa
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 83ff3b6..b9dc7ec 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -452,13 +452,13 @@
 
     virtual void setPostTime(nsecs_t /*postTime*/) {}
     virtual void setDesiredPresentTime(nsecs_t /*desiredPresentTime*/) {}
+    virtual RoundedCornerState getRoundedCornerStateInternal(const FloatRect bounds) const;
 
 protected:
     virtual bool prepareClientLayer(const RenderArea& renderArea, const Region& clip,
                                     bool useIdentityTransform, Region& clearRegion,
                                     const bool supportProtectedContent,
                                     renderengine::LayerSettings& layer);
-
 public:
     /*
      * compositionengine::LayerFE overrides
@@ -908,8 +908,6 @@
      */
     Rect getCroppedBufferSize(const Layer::State& s) const;
 
-    RoundedCornerState getRoundedCornerStateInternal(const FloatRect bounds) const;
-
     // Cached properties computed from drawing state
     // Effective transform taking into account parent transforms and any parent scaling.
     ui::Transform mEffectiveTransform;