Use on-screen coords to test transformMatrixToGlobal

JavaDoc of transformMatrixToGlobal says it transforms a matrix to
on-screen coods from view-local coords, and it does consider
AttachInfo#window{Left, Top} by allowing ViewRootImpl transform the
matrix. However the CTS uses View#getLocationInWindow() to test its
result, which of course mismatch on-screen coords when a window isn't at
origin, e.g. when it's a freeform window. Luckily we have
View#getLocationOnScreen() to use.

Theses 2 methods has a very similar process of transformation, except
that View#getLocationInWindow() applies window offset at last, while
View#transformMatrixToGlobal() applies ViewRootImpl's scroll at last.
They for now are all translations so they are commutative now. However
if they ever become non-commutative either one of those 2 API will break
so we can take another look at it when that happens.

Bug: 161575149
Test: atest ViewTest#testTransformMatrixToGlobal on freeform-first
devices.
Test: atest ViewTest#testTransformMatrixToGlobal on crosshatch.

Change-Id: If0079d9a7082de880044227b5f03a3c06c794570
1 file changed