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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 Surface* SurfaceManager::GetSurfaceForId(SurfaceId surface_id) { | 73 Surface* SurfaceManager::GetSurfaceForId(SurfaceId surface_id) { |
74 DCHECK(thread_checker_.CalledOnValidThread()); | 74 DCHECK(thread_checker_.CalledOnValidThread()); |
75 SurfaceMap::iterator it = surface_map_.find(surface_id); | 75 SurfaceMap::iterator it = surface_map_.find(surface_id); |
76 if (it == surface_map_.end()) | 76 if (it == surface_map_.end()) |
77 return NULL; | 77 return NULL; |
78 return it->second; | 78 return it->second; |
79 } | 79 } |
80 | 80 |
81 void SurfaceManager::SurfaceModified(SurfaceId surface_id) { | 81 bool SurfaceManager::SurfaceModified(SurfaceId surface_id) { |
82 DCHECK(thread_checker_.CalledOnValidThread()); | 82 DCHECK(thread_checker_.CalledOnValidThread()); |
83 FOR_EACH_OBSERVER( | 83 bool changed = false; |
84 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id)); | 84 FOR_EACH_OBSERVER(SurfaceDamageObserver, observer_list_, |
| 85 OnSurfaceDamaged(surface_id, &changed)); |
| 86 return changed; |
85 } | 87 } |
86 | 88 |
87 } // namespace cc | 89 } // namespace cc |
OLD | NEW |