| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
| 9 #include "cc/surfaces/surface_id_allocator.h" | 9 #include "cc/surfaces/surface_id_allocator.h" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 surface_map_.erase(it); | 38 surface_map_.erase(it); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void SurfaceManager::DestroyOnSequence( | 41 void SurfaceManager::DestroyOnSequence( |
| 42 scoped_ptr<Surface> surface, | 42 scoped_ptr<Surface> surface, |
| 43 const std::set<SurfaceSequence>& dependency_set) { | 43 const std::set<SurfaceSequence>& dependency_set) { |
| 44 surfaces_to_destroy_.push_back(make_pair(surface.release(), dependency_set)); | 44 surfaces_to_destroy_.push_back(make_pair(surface.release(), dependency_set)); |
| 45 SearchForSatisfaction(); | 45 SearchForSatisfaction(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SurfaceManager::DidSatisfySequences(SurfaceId id, | 48 void SurfaceManager::DidSatisfySequences(uint32_t id_namespace, |
| 49 std::vector<uint32_t>* sequence) { | 49 std::vector<uint32_t>* sequence) { |
| 50 for (std::vector<uint32_t>::iterator it = sequence->begin(); | 50 for (std::vector<uint32_t>::iterator it = sequence->begin(); |
| 51 it != sequence->end(); | 51 it != sequence->end(); |
| 52 ++it) { | 52 ++it) { |
| 53 satisfied_sequences_.insert( | 53 satisfied_sequences_.insert(SurfaceSequence(id_namespace, *it)); |
| 54 SurfaceSequence(SurfaceIdAllocator::NamespaceForId(id), *it)); | |
| 55 } | 54 } |
| 56 sequence->clear(); | 55 sequence->clear(); |
| 57 SearchForSatisfaction(); | 56 SearchForSatisfaction(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 void SurfaceManager::SearchForSatisfaction() { | 59 void SurfaceManager::SearchForSatisfaction() { |
| 61 for (SurfaceDestroyList::iterator dest_it = surfaces_to_destroy_.begin(); | 60 for (SurfaceDestroyList::iterator dest_it = surfaces_to_destroy_.begin(); |
| 62 dest_it != surfaces_to_destroy_.end();) { | 61 dest_it != surfaces_to_destroy_.end();) { |
| 63 std::set<SurfaceSequence>& dependency_set = dest_it->second; | 62 std::set<SurfaceSequence>& dependency_set = dest_it->second; |
| 64 | 63 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 91 return it->second; | 90 return it->second; |
| 92 } | 91 } |
| 93 | 92 |
| 94 void SurfaceManager::SurfaceModified(SurfaceId surface_id) { | 93 void SurfaceManager::SurfaceModified(SurfaceId surface_id) { |
| 95 DCHECK(thread_checker_.CalledOnValidThread()); | 94 DCHECK(thread_checker_.CalledOnValidThread()); |
| 96 FOR_EACH_OBSERVER( | 95 FOR_EACH_OBSERVER( |
| 97 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id)); | 96 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id)); |
| 98 } | 97 } |
| 99 | 98 |
| 100 } // namespace cc | 99 } // namespace cc |
| OLD | NEW |