| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/surfaces/surface_manager.h" | 5 #include "cc/surfaces/surface_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 Surface* surface, | 487 Surface* surface, |
| 488 const base::flat_set<SurfaceId>& added_dependencies, | 488 const base::flat_set<SurfaceId>& added_dependencies, |
| 489 const base::flat_set<SurfaceId>& removed_dependencies) { | 489 const base::flat_set<SurfaceId>& removed_dependencies) { |
| 490 if (dependency_tracker_) { | 490 if (dependency_tracker_) { |
| 491 dependency_tracker_->OnSurfaceDependenciesChanged( | 491 dependency_tracker_->OnSurfaceDependenciesChanged( |
| 492 surface, added_dependencies, removed_dependencies); | 492 surface, added_dependencies, removed_dependencies); |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 void SurfaceManager::SurfaceDiscarded(Surface* surface) { | 496 void SurfaceManager::SurfaceDiscarded(Surface* surface) { |
| 497 for (auto& observer : observer_list_) |
| 498 observer.OnSurfaceDiscarded(surface->surface_id()); |
| 497 if (dependency_tracker_) | 499 if (dependency_tracker_) |
| 498 dependency_tracker_->OnSurfaceDiscarded(surface); | 500 dependency_tracker_->OnSurfaceDiscarded(surface); |
| 499 } | 501 } |
| 500 | 502 |
| 501 void SurfaceManager::UnregisterSurface(const SurfaceId& surface_id) { | 503 void SurfaceManager::UnregisterSurface(const SurfaceId& surface_id) { |
| 502 DCHECK(thread_checker_.CalledOnValidThread()); | 504 DCHECK(thread_checker_.CalledOnValidThread()); |
| 503 SurfaceMap::iterator it = surface_map_.find(surface_id); | 505 SurfaceMap::iterator it = surface_map_.find(surface_id); |
| 504 DCHECK(it != surface_map_.end()); | 506 DCHECK(it != surface_map_.end()); |
| 505 surface_map_.erase(it); | 507 surface_map_.erase(it); |
| 506 RemoveAllSurfaceReferences(surface_id); | 508 RemoveAllSurfaceReferences(surface_id); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); | 545 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); |
| 544 std::sort(children.begin(), children.end()); | 546 std::sort(children.begin(), children.end()); |
| 545 | 547 |
| 546 for (const SurfaceId& child_id : children) | 548 for (const SurfaceId& child_id : children) |
| 547 SurfaceReferencesToStringImpl(child_id, indent + " ", str); | 549 SurfaceReferencesToStringImpl(child_id, indent + " ", str); |
| 548 } | 550 } |
| 549 } | 551 } |
| 550 #endif // DCHECK_IS_ON() | 552 #endif // DCHECK_IS_ON() |
| 551 | 553 |
| 552 } // namespace cc | 554 } // namespace cc |
| OLD | NEW |