Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1394)

Unified Diff: ash/rotator/screen_rotation_animator.h

Issue 2780823002: Uses copy request to flatten the layers to do screen rotation animation. (Closed)
Patch Set: Remove duplicated entry in flags. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/rotator/screen_rotation_animator.h
diff --git a/ash/rotator/screen_rotation_animator.h b/ash/rotator/screen_rotation_animator.h
index b541106e88030c68a5217cc03451e46268688eae..c7aaea9d19bb63efc16063227a41dbfcf418c00b 100644
--- a/ash/rotator/screen_rotation_animator.h
+++ b/ash/rotator/screen_rotation_animator.h
@@ -13,6 +13,10 @@
#include "base/observer_list.h"
#include "ui/display/display.h"
+namespace cc {
+class CopyOutputResult;
+} // namespace cc
+
namespace ui {
class AnimationMetricsReporter;
class Layer;
@@ -59,7 +63,29 @@ class ASH_EXPORT ScreenRotationAnimator {
friend class ash::test::ScreenRotationAnimatorTestApi;
struct ScreenRotationRequest;
- // Set the screen orientation to |new_rotation| and animate the change. The
+ void StartRotationAnimation(
+ std::unique_ptr<ScreenRotationRequest> rotation_request);
+
+ // This is an asynchronous call to request copy output of root layer. In the
+ // callback, either succeeded or fail, it will call |AnimateRotation()|.
+ void RequestCopyRootLayerAndAnimateRotation(
+ std::unique_ptr<ScreenRotationRequest> rotation_request);
+
+ // The callback in |RequestCopyRootLayerAndAnimateRotation()|. No matter the
+ // request is succeeded or fail, it will call |AnimateRotation()|.
+ void OnRootLayerCopiedBeforeRotation(
+ std::unique_ptr<ScreenRotationRequest> rotation_request,
+ std::unique_ptr<cc::CopyOutputResult> result);
+
+ // Recreates all |root_window| layers.
+ void CreateOldLayerTree();
+
+ // Requests a copy of |root_window| root layer output.
+ void CopyOldLayerTree(std::unique_ptr<cc::CopyOutputResult> result);
+
+ // Note: Only call this function when the |old_layer_tree_owner_| is set up
+ // properly.
+ // Sets the screen orientation to |new_rotation| and animate the change. The
// animation will rotate the initial orientation's layer towards the new
// orientation through |rotation_degrees| while fading out, and the new
// orientation's layer will be rotated in to the |new_orientation| through

Powered by Google App Engine
This is Rietveld 408576698