Avoid resetting gradient state when not actually rebuilding it

Previous logic in GradientDrawable around rebuilding the gradient path
was incorrect, but it happened to work because of when it was called
(after ensureValidRect() in the draw() method). Further reliance on this
logic outside of the drawing cycle (in the new getOutline() method) caused
the side-effect to surface as we now clear the dirty flag without actually
rebuilding the gradient.

Fix avoids resetting the flag outside of ensureValidRect() where it belongs.

Issue #15508378 Quantum ui having issues with viewing comments on facebook app

Change-Id: Ia944d3de7e3c0920fed040188e8c1cc1bcce498d
1 file changed