Chromium Code Reviews| Index: ash/display/display_controller.cc |
| diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
| index e777dfc577d71c5444157ec7f770ae4a1792ca87..4366d4d904393658439915750a0884cde5eb7e02 100644 |
| --- a/ash/display/display_controller.cc |
| +++ b/ash/display/display_controller.cc |
| @@ -134,6 +134,12 @@ void RotateRootWindow(aura::RootWindow* root_window, |
| root_window->SetProperty(kRotationPropertyKey, info.rotation()); |
| #endif |
| gfx::Transform rotate; |
| + // TODO(oshima): Manually complute the invert of the |
|
sky
2013/03/25 16:04:32
complute -> compute
invert -> inverse
oshima
2013/03/25 17:49:31
Done.
|
| + // rotate+translate matrix to compensate computation error in |
|
sky
2013/03/25 16:04:32
'to compensate' -> 'to compensate for'
oshima
2013/03/25 17:49:31
Done.
|
| + // inverted matrix. Ideally, SkMatrix should have special |
|
sky
2013/03/25 16:04:32
inverted -> the intervted
oshima
2013/03/25 17:49:31
Done.
|
| + // case handling for rotate+translate case. crbug.com/222483. |
| + gfx::Transform reverse_rotate; |
| + |
| // The origin is (0, 0), so the translate width/height must be reduced by 1. |
| switch (info.rotation()) { |
| case gfx::Display::ROTATE_0: |
| @@ -141,18 +147,26 @@ void RotateRootWindow(aura::RootWindow* root_window, |
| case gfx::Display::ROTATE_90: |
| rotate.Translate(display.bounds().height() - 1, 0); |
| rotate.Rotate(90); |
| + // Rotate 270 instead of 90 as it will cause calcuration error. |
| + reverse_rotate.Rotate(270); |
| + reverse_rotate.Translate(-(display.bounds().height() - 1), 0); |
| break; |
| case gfx::Display::ROTATE_270: |
| rotate.Translate(0, display.bounds().width() - 1); |
| rotate.Rotate(270); |
| + reverse_rotate.Rotate(90); |
| + reverse_rotate.Translate(0, -(display.bounds().width() - 1)); |
| break; |
| case gfx::Display::ROTATE_180: |
| rotate.Translate(display.bounds().width() - 1, |
| display.bounds().height() - 1); |
| rotate.Rotate(180); |
| + reverse_rotate.Rotate(180); |
| + reverse_rotate.Translate(-(display.bounds().width() - 1), |
| + -(display.bounds().height() - 1)); |
| break; |
| } |
| - root_window->SetTransform(rotate); |
| + root_window->SetTransformPair(rotate, reverse_rotate); |
| } |
| void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root, |