chromeos: v2 of account for transform set on root for coordinate conversion
When a ui scale is in effect a transform is set on the client visible
display root. This patch makes the transform be taken into account
when determining the location of events. This means that when the
client gets a window relative location it's been transformed by the
effective ui scale (the transform set on the root). This means the
code in Event::UpdateForRootTransform() needs to take that into
account.
This also fixes a bug in how window_finder was calculating
locations. Matrix multiplication was done in the wrong order. Added
test coverage.
BUG=726865
TEST=covered by tests
Change-Id: Icbd3a8eb2d29abd7dcde506c5d05bcafd7f197bd
Reviewed-on: https://chromium-review.googlesource.com/629596
Commit-Queue: Scott Violet <[email protected]>
Reviewed-by: Sadrul Chowdhury <[email protected]>
Cr-Commit-Position: refs/heads/master@{#497537}
diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h
index 31301558..e30f72c 100644
--- a/ui/aura/window_tree_host.h
+++ b/ui/aura/window_tree_host.h
@@ -83,6 +83,13 @@
virtual void SetRootTransform(const gfx::Transform& transform);
virtual gfx::Transform GetInverseRootTransform() const;
+ // These functions are used in event translation for translating the local
+ // coordinates of LocatedEvents. Default implementation calls to non-event
+ // ones (e.g. GetRootTransform()).
+ virtual gfx::Transform GetRootTransformForLocalEventCoordinates() const;
+ virtual gfx::Transform GetInverseRootTransformForLocalEventCoordinates()
+ const;
+
// Sets padding applied to the output surface. The output surface is sized to
// to the size of the host plus output surface padding. |window()| is offset
// by |padding_in_pixels|, that is, |window|'s origin is set to