New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 757851 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Rotated screenshot should be taken after display is rotated.

Project Member Reported by osh...@chromium.org, Aug 22 2017

Issue description

Currently the actual rotation changes after the screenshot is taken,
which can cause race condition due to inconsistent state.

I think it's better to *logically* rotate the display + rotate
window back, then take the screenshot.

It'd be nice if we can fix this by 61, but 62 is fine if it's complicated.


 

Comment 1 by wutao@chromium.org, Aug 22 2017

Cc: osh...@chromium.org
Hi Oshima, based on our conversation. I some thoughts for now. Seems we needs at least two functions that allow us only set display rotation and only update window size:

1. We call display_manager_->SetDisplayRotation() to set the orientation. This will trigger SetRootWindowTransformer() and then UpdateWindowSize().

* We do not want to resize window at this point. We need to have a mechanism to tell SetRootWindowTransformer() that "do not resize now".

2. After SetDisplayRotation(), every status is rotated but not the window size. When rotation animation finish or abort, we need to explicitly UpdateWindowSize(). 

Comment 2 by osh...@chromium.org, Aug 22 2017

For short term, let's use the old rotation when switching between tablet <-> clamshell.

Comment 3 by wutao@chromium.org, Aug 23 2017

I am thinking to add a new argument to DisplayConfigurationController::SetDisplayRotation [1] so that in the ScreenRotationAnimator, we know to use the old rotation.

Or we can set a scoped global flag in shell or DisplayConfigurationController, which can be access in ScreenRotationAnimator.

https://cs.chromium.org/chromium/src/ash/display/display_configuration_controller.cc?l=110&rcl=fc5049622fedc52ab603377dd945032faa72f996

Comment 4 by osh...@chromium.org, Aug 23 2017

I'm fine with either way.

Comment 5 by wutao@chromium.org, Aug 28 2017

Labels: Merge-Request-61
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 28 2017

Labels: -Merge-Request-61 Merge-Review-61 Hotlist-Merge-Review
This bug requires manual review: We are only 7 days from stable.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ee77a567d98db38bfe3aa72ed4808f4b67beffba

commit ee77a567d98db38bfe3aa72ed4808f4b67beffba
Author: wutao <wutao@chromium.org>
Date: Mon Aug 28 19:11:30 2017

CrOS: Using slow screen rotation animation when existing tablet mode.

Currently screen rotation takes place after a screenshot is taken, which
can cause race condition due to inconsistent state. We plan to modify
the logic to rotate the screen first and then do the animation. In a
short term solution, we force to use slow screen rotation animation when
existing the tablet mode.

Changes:
1. add a new enum RotationAnimation.
2. call with the new enum for rotation when tablet mode is ending.
3. screen_rotation_animator checks the rotation request before rotating.

Bug: 757851
Test: on linux build can call slow screen rotation.
Change-Id: Ia03d14c630600c0be5bd6eb43909759bb6a5e278
Reviewed-on: https://chromium-review.googlesource.com/627270
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497827}
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/display/display_configuration_controller.cc
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/display/display_configuration_controller.h
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/display/display_configuration_controller_unittest.cc
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/display/screen_orientation_controller_chromeos.cc
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/display/screen_orientation_controller_chromeos.h
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/rotator/screen_rotation_animator.cc
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/rotator/screen_rotation_animator.h
[modify] https://crrev.com/ee77a567d98db38bfe3aa72ed4808f4b67beffba/ash/rotator/screen_rotation_animator_unittest.cc

Labels: -Merge-Review-61 Merge-Approved-61
Approving merge to M61.
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 30 2017

Labels: -merge-approved-61 merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e

commit 7f636fd4b7c1bb713dbbc03d90f4904a45213c4e
Author: Mitsuru Oshima <oshima@chromium.org>
Date: Wed Aug 30 00:58:12 2017

CrOS: Using slow screen rotation animation when existing tablet mode.

Currently screen rotation takes place after a screenshot is taken, which
can cause race condition due to inconsistent state. We plan to modify
the logic to rotate the screen first and then do the animation. In a
short term solution, we force to use slow screen rotation animation when
existing the tablet mode.

Changes:
1. add a new enum RotationAnimation.
2. call with the new enum for rotation when tablet mode is ending.
3. screen_rotation_animator checks the rotation request before rotating.

(cherry picked from commit ee77a567d98db38bfe3aa72ed4808f4b67beffba)

Bug: 757851
Test: on linux build can call slow screen rotation.
Change-Id: Ia9bc7f8249f802036a72ccdcb19758e85f6ccc92
Reviewed-on: https://chromium-review.googlesource.com/627270
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#497827}
Reviewed-on: https://chromium-review.googlesource.com/642528
Cr-Commit-Position: refs/branch-heads/3163@{#986}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/display/display_configuration_controller.cc
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/display/display_configuration_controller.h
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/display/display_configuration_controller_unittest.cc
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/display/screen_orientation_controller_chromeos.cc
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/display/screen_orientation_controller_chromeos.h
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/rotator/screen_rotation_animator.cc
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/rotator/screen_rotation_animator.h
[modify] https://crrev.com/7f636fd4b7c1bb713dbbc03d90f4904a45213c4e/ash/rotator/screen_rotation_animator_unittest.cc

Components: UI>Shell
Cc: wutao@chromium.org
Labels: -Pri-1 Pri-3
Owner: osh...@chromium.org
Hi oshima@, do we still need this?

Sign in to add a comment