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

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

Issue 2910413002: cros: Do not cache |root_window| in ScreenRotationAnimator. (Closed)
Patch Set: Remove IsDisplayValid check. Created 3 years, 6 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
« no previous file with comments | « no previous file | ash/display/display_configuration_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_
6 #define ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ 6 #define ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 class DisplayChangeLimiter; 70 class DisplayChangeLimiter;
71 71
72 // Sets the timeout for the DisplayChangeLimiter if it exists. Call this 72 // Sets the timeout for the DisplayChangeLimiter if it exists. Call this
73 // *before* starting any animations. 73 // *before* starting any animations.
74 void SetThrottleTimeout(int64_t throttle_ms); 74 void SetThrottleTimeout(int64_t throttle_ms);
75 bool IsLimited(); 75 bool IsLimited();
76 void SetDisplayLayoutImpl(std::unique_ptr<display::DisplayLayout> layout); 76 void SetDisplayLayoutImpl(std::unique_ptr<display::DisplayLayout> layout);
77 void SetMirrorModeImpl(bool mirror); 77 void SetMirrorModeImpl(bool mirror);
78 void SetPrimaryDisplayIdImpl(int64_t display_id); 78 void SetPrimaryDisplayIdImpl(int64_t display_id);
79 79
80 // Returns the ScreenRotationAnimator associated with the |display_id|. If 80 // Returns the ScreenRotationAnimator associated with the |display_id|'s
81 // there is no existing ScreenRotationAnimator for |display_id|, it will make 81 // |root_window|. If there is no existing ScreenRotationAnimator for
82 // one and store the pair in the |rotation_animator_map_|. 82 // |root_window|, it will make one and store in the |root_window| property
83 // |kScreenRotationAnimatorKey|.
83 ScreenRotationAnimator* GetScreenRotationAnimatorForDisplay( 84 ScreenRotationAnimator* GetScreenRotationAnimatorForDisplay(
84 int64_t display_id); 85 int64_t display_id);
85 86
86 display::DisplayManager* display_manager_; // weak ptr 87 display::DisplayManager* display_manager_; // weak ptr
87 WindowTreeHostManager* window_tree_host_manager_; // weak ptr 88 WindowTreeHostManager* window_tree_host_manager_; // weak ptr
88 std::unique_ptr<DisplayAnimator> display_animator_; 89 std::unique_ptr<DisplayAnimator> display_animator_;
89 std::unique_ptr<DisplayChangeLimiter> limiter_; 90 std::unique_ptr<DisplayChangeLimiter> limiter_;
90 91
91 // Tracks |display_id| to ScreenRotationAnimator mappings. The
92 // |rotation_animator_map_| is populated on demand the first time a
93 // ScreenRotationAnimator is needed for a given |display_id|.
94 // On animation ended or aborted, the animator may be deleted if there is no
95 // more pending rotation request.
96 std::unordered_map<int64_t, std::unique_ptr<ScreenRotationAnimator>>
97 rotation_animator_map_;
98
99 base::WeakPtrFactory<DisplayConfigurationController> weak_ptr_factory_; 92 base::WeakPtrFactory<DisplayConfigurationController> weak_ptr_factory_;
100 93
101 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationController); 94 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationController);
102 }; 95 };
103 96
104 } // namespace ash 97 } // namespace ash
105 98
106 #endif // ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ 99 #endif // ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_configuration_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698