OSDN Git Service

Prevent LayerDrawable bounds updates from being re-entrant
authorAlan Viverette <alanv@google.com>
Tue, 24 May 2016 19:14:38 +0000 (15:14 -0400)
committerAlan Viverette <alanv@google.com>
Tue, 24 May 2016 19:14:38 +0000 (15:14 -0400)
commit09deff1bd970bd6749d78b6c85026a9985e6a1f3
treef972a9003923ba5a13167db63ad98c4735ebcaa7
parentcdcc53d007d613ccfcf3a36ce22fa6823c5fe954
Prevent LayerDrawable bounds updates from being re-entrant

Collect child invalidations during layer bounds change, then dispatch a
single invalidation if any children requested invalidation. This prevents
re-entrance from, for example, a LayerDrawable.updateLayerBounds() call
invoking setBounds() on a child, which necessarily calls invalidateSelf()
and immediately propagates up to ImageView.invalidateDrawable(), which
then calls configureBounds() and puts us back in updateLayerBounds().

Bug: 28636072
Change-Id: I36c9eefc18904d493292d51b37e4b05cfddcf794
graphics/java/android/graphics/drawable/LayerDrawable.java