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

Unified Diff: ash/rotator/screen_rotation_animator.h

Issue 2816683002: Handle new screen rotation request while waiting for the copy request callback. (Closed)
Patch Set: Fix for the comments in patch 1. Created 3 years, 8 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
« no previous file with comments | « no previous file | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/rotator/screen_rotation_animator.h
diff --git a/ash/rotator/screen_rotation_animator.h b/ash/rotator/screen_rotation_animator.h
index 4c219222ab3a97226b8a5c7ee44c6b4da717131c..ce77673d356d949614e4d4f6714cc5ee5bc0b357 100644
--- a/ash/rotator/screen_rotation_animator.h
+++ b/ash/rotator/screen_rotation_animator.h
@@ -64,9 +64,11 @@ class ASH_EXPORT ScreenRotationAnimator {
using CopyCallback =
base::Callback<void(std::unique_ptr<cc::CopyOutputResult> result)>;
struct ScreenRotationRequest {
- ScreenRotationRequest(display::Display::Rotation to_rotation,
+ ScreenRotationRequest(int64_t id,
+ display::Display::Rotation to_rotation,
display::Display::RotationSource from_source)
- : new_rotation(to_rotation), source(from_source) {}
+ : id(id), new_rotation(to_rotation), source(from_source) {}
+ int64_t id;
display::Display::Rotation new_rotation;
display::Display::RotationSource source;
};
@@ -123,6 +125,10 @@ class ASH_EXPORT ScreenRotationAnimator {
};
ScreenRotationState screen_rotation_state_;
+ // Rotation request id, used to ignore copy request callback if we decide to
+ // cancel the previous rotation request.
+ int64_t rotation_request_id_;
oshima 2017/04/13 18:18:24 = 0
wutao 2017/04/13 18:54:30 Keep as it. I init it in the init list.
+
std::unique_ptr<ui::AnimationMetricsReporter> metrics_reporter_;
// Only set in unittest to disable animation timers.
bool disable_animation_timers_for_test_;
« no previous file with comments | « no previous file | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698