Correct setLayer variants.

Correct a legitimate bug in setLayer where it would fail
to clear a relative layer equal to the new absolute layer. Optimize
all the other variants to not trigger rebuilding of layer stacks in
the case of redundant Z setting.

Test: Existing tests pass.
Change-Id: I6559322017a7b8c5510f8ff265216af3d414696a
1 file changed