Update Root Window Bounds After Rotation
Properly update the root window bounds after updating the root transform. Previously, the call to window()->SetTransform() would update the transform, but it would not call UpdateRootWindowSizeInPixels(). The call to this function is what updates the root window bounds rect with the new transform after it is set. Using the translation + rotation transforms, if the base WindowTreeHost::UpdaterootWindowSizeInPixels() function is used, you end up with bounds represented by a rect with it's own origin not actually at (0,0). For example, with a rotation of 270 degrees applied to a 600x1024 display, you end up with bounds represented as a rect with its origin at (-1, 508) and its other corner at (1228, 1228) in the device-independent coordinates. By overriding this function in CastWindowTreeHost, after the new transform is applied to the root window bounds, these bounds are shifted back so that their origin is at (0,0). This allows located events to properly check whether or not they are contained within the root window. BUG=None TEST=Check touch events on displays with rotation applied. Change-Id: Ib5c5ec2ab9d82cd2f589bc6301e4b7b6dd712c5c Reviewed-on: https://chromium-review.googlesource.com/941728Reviewed-by:Michael Spang <spang@chromium.org> Reviewed-by:
Alex Sakhartchouk <alexst@chromium.org> Reviewed-by:
Luke Halliwell <halliwell@chromium.org> Commit-Queue: Cody Peterson <crpeterson@chromium.org> Cr-Commit-Position: refs/heads/master@{#539997}
Showing
Please register or sign in to comment