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

Side by Side Diff: ash/display/display_configuration_controller.cc

Issue 2790583004: Add second copy request after screen rotation to flatten the layers in animation. (Closed)
Patch Set: Separate the two test sets for slow/smooth animation. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/display_configuration_controller.h" 5 #include "ash/display/display_configuration_controller.h"
6 6
7 #include "ash/display/display_animator.h" 7 #include "ash/display/display_animator.h"
8 #include "ash/display/display_animator_chromeos.h" 8 #include "ash/display/display_animator_chromeos.h"
9 #include "ash/display/display_util.h" 9 #include "ash/display/display_util.h"
10 #include "ash/rotator/screen_rotation_animator.h" 10 #include "ash/rotator/screen_rotation_animator.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } else { 126 } else {
127 SetPrimaryDisplayIdImpl(display_id); 127 SetPrimaryDisplayIdImpl(display_id);
128 } 128 }
129 } 129 }
130 130
131 void DisplayConfigurationController::OnDisplayConfigurationChanged() { 131 void DisplayConfigurationController::OnDisplayConfigurationChanged() {
132 // TODO(oshima): Stop all animations. 132 // TODO(oshima): Stop all animations.
133 SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); 133 SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs);
134 } 134 }
135 135
136 void DisplayConfigurationController::OnScreenRotationAnimationFinished(
137 ScreenRotationAnimator* screen_rotation_animator) {
138 const int64_t display_id = screen_rotation_animator->display_id();
139
140 DCHECK(rotation_animator_map_.count(display_id));
141
142 screen_rotation_animator->RemoveScreenRotationAnimatorObserver(this);
143 rotation_animator_map_.erase(screen_rotation_animator->display_id());
144 }
145
146 // Protected 136 // Protected
147 137
148 void DisplayConfigurationController::ResetAnimatorForTest() { 138 void DisplayConfigurationController::ResetAnimatorForTest() {
149 if (!display_animator_) 139 if (!display_animator_)
150 return; 140 return;
151 display_animator_.reset(); 141 display_animator_.reset();
152 } 142 }
153 143
154 // Private 144 // Private
155 145
(...skipping 27 matching lines...) Expand all
183 } 173 }
184 174
185 ScreenRotationAnimator* 175 ScreenRotationAnimator*
186 DisplayConfigurationController::GetScreenRotationAnimatorForDisplay( 176 DisplayConfigurationController::GetScreenRotationAnimatorForDisplay(
187 int64_t display_id) { 177 int64_t display_id) {
188 auto iter = rotation_animator_map_.find(display_id); 178 auto iter = rotation_animator_map_.find(display_id);
189 if (iter != rotation_animator_map_.end()) 179 if (iter != rotation_animator_map_.end())
190 return iter->second.get(); 180 return iter->second.get();
191 181
192 auto animator = base::MakeUnique<ScreenRotationAnimator>(display_id); 182 auto animator = base::MakeUnique<ScreenRotationAnimator>(display_id);
193 animator->AddScreenRotationAnimatorObserver(this);
194 ScreenRotationAnimator* result = animator.get(); 183 ScreenRotationAnimator* result = animator.get();
195 rotation_animator_map_.insert( 184 rotation_animator_map_.insert(
196 std::make_pair(display_id, std::move(animator))); 185 std::make_pair(display_id, std::move(animator)));
197 return result; 186 return result;
198 } 187 }
199 188
200 } // namespace ash 189 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_configuration_controller.h ('k') | ash/display/display_configuration_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698