Fix dirty region updates if a layer becomes invisible

Ensure we correctly update the output layer's
dirty region if a layer becomes invisible.

Flag: EXEMPT bug fix
Bug: 330785038
Test: presubmit
Change-Id: I38c501320316babe6ba12c49d9d542c4f6103aaa
3 files changed