OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/surface.h" | 5 #include "components/exo/surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 window_->AddObserver(this); | 198 window_->AddObserver(this); |
199 aura::Env::GetInstance()->context_factory()->AddObserver(this); | 199 aura::Env::GetInstance()->context_factory()->AddObserver(this); |
200 } | 200 } |
201 | 201 |
202 Surface::~Surface() { | 202 Surface::~Surface() { |
203 aura::Env::GetInstance()->context_factory()->RemoveObserver(this); | 203 aura::Env::GetInstance()->context_factory()->RemoveObserver(this); |
204 for (SurfaceObserver& observer : observers_) | 204 for (SurfaceObserver& observer : observers_) |
205 observer.OnSurfaceDestroying(this); | 205 observer.OnSurfaceDestroying(this); |
206 | 206 |
207 window_->RemoveObserver(this); | 207 window_->RemoveObserver(this); |
208 if (window_->layer()->GetCompositor()) | |
209 window_->layer()->GetCompositor()->vsync_manager()->RemoveObserver(this); | |
Fady Samuel
2017/01/11 20:33:04
drive-by question: What does exo use the vsync man
reveman
2017/01/11 21:52:08
We use it to implement the presentation time proto
| |
208 window_->layer()->SetShowSolidColorContent(); | 210 window_->layer()->SetShowSolidColorContent(); |
209 | 211 |
210 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_); | 212 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_); |
211 active_frame_callbacks_.splice(active_frame_callbacks_.end(), | 213 active_frame_callbacks_.splice(active_frame_callbacks_.end(), |
212 frame_callbacks_); | 214 frame_callbacks_); |
213 // Call all frame callbacks with a null frame time to indicate that they | 215 // Call all frame callbacks with a null frame time to indicate that they |
214 // have been cancelled. | 216 // have been cancelled. |
215 for (const auto& frame_callback : active_frame_callbacks_) | 217 for (const auto& frame_callback : active_frame_callbacks_) |
216 frame_callback.Run(base::TimeTicks()); | 218 frame_callback.Run(base::TimeTicks()); |
217 | 219 |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 | 849 |
848 int64_t Surface::GetPropertyInternal(const void* key, | 850 int64_t Surface::GetPropertyInternal(const void* key, |
849 int64_t default_value) const { | 851 int64_t default_value) const { |
850 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 852 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
851 if (iter == prop_map_.end()) | 853 if (iter == prop_map_.end()) |
852 return default_value; | 854 return default_value; |
853 return iter->second.value; | 855 return iter->second.value; |
854 } | 856 } |
855 | 857 |
856 } // namespace exo | 858 } // namespace exo |
OLD | NEW |