| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId(); | 218 aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId(); |
| 219 factory_owner_->id_allocator_.reset(new cc::SurfaceIdAllocator()); | 219 factory_owner_->id_allocator_.reset(new cc::SurfaceIdAllocator()); |
| 220 surface_manager_->RegisterFrameSinkId(factory_owner_->frame_sink_id_); | 220 surface_manager_->RegisterFrameSinkId(factory_owner_->frame_sink_id_); |
| 221 factory_owner_->surface_factory_.reset(new cc::SurfaceFactory( | 221 factory_owner_->surface_factory_.reset(new cc::SurfaceFactory( |
| 222 factory_owner_->frame_sink_id_, surface_manager_, factory_owner_.get())); | 222 factory_owner_->frame_sink_id_, surface_manager_, factory_owner_.get())); |
| 223 aura::Env::GetInstance()->context_factory()->AddObserver(this); | 223 aura::Env::GetInstance()->context_factory()->AddObserver(this); |
| 224 } | 224 } |
| 225 | 225 |
| 226 Surface::~Surface() { | 226 Surface::~Surface() { |
| 227 aura::Env::GetInstance()->context_factory()->RemoveObserver(this); | 227 aura::Env::GetInstance()->context_factory()->RemoveObserver(this); |
| 228 FOR_EACH_OBSERVER(SurfaceObserver, observers_, OnSurfaceDestroying(this)); | 228 for (SurfaceObserver& observer : observers_) |
| 229 observer.OnSurfaceDestroying(this); |
| 229 | 230 |
| 230 window_->layer()->SetShowSolidColorContent(); | 231 window_->layer()->SetShowSolidColorContent(); |
| 231 | 232 |
| 232 factory_owner_->surface_ = nullptr; | 233 factory_owner_->surface_ = nullptr; |
| 233 | 234 |
| 234 // Call pending frame callbacks with a null frame time to indicate that they | 235 // Call pending frame callbacks with a null frame time to indicate that they |
| 235 // have been cancelled. | 236 // have been cancelled. |
| 236 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_); | 237 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_); |
| 237 active_frame_callbacks_.splice(active_frame_callbacks_.end(), | 238 active_frame_callbacks_.splice(active_frame_callbacks_.end(), |
| 238 frame_callbacks_); | 239 frame_callbacks_); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 | 850 |
| 850 int64_t Surface::GetPropertyInternal(const void* key, | 851 int64_t Surface::GetPropertyInternal(const void* key, |
| 851 int64_t default_value) const { | 852 int64_t default_value) const { |
| 852 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 853 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
| 853 if (iter == prop_map_.end()) | 854 if (iter == prop_map_.end()) |
| 854 return default_value; | 855 return default_value; |
| 855 return iter->second.value; | 856 return iter->second.value; |
| 856 } | 857 } |
| 857 | 858 |
| 858 } // namespace exo | 859 } // namespace exo |
| OLD | NEW |