Chromium Code Reviews| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 } | 114 } |
| 115 | 115 |
| 116 void SurfaceManager::SatisfySequence(const SurfaceSequence& sequence) { | 116 void SurfaceManager::SatisfySequence(const SurfaceSequence& sequence) { |
| 117 DCHECK(thread_checker_.CalledOnValidThread()); | 117 DCHECK(thread_checker_.CalledOnValidThread()); |
| 118 DCHECK_EQ(lifetime_type_, LifetimeType::SEQUENCES); | 118 DCHECK_EQ(lifetime_type_, LifetimeType::SEQUENCES); |
| 119 satisfied_sequences_.insert(sequence); | 119 satisfied_sequences_.insert(sequence); |
| 120 GarbageCollectSurfaces(); | 120 GarbageCollectSurfaces(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SurfaceManager::RegisterFrameSinkId(const FrameSinkId& frame_sink_id) { | 123 void SurfaceManager::RegisterFrameSinkId(const FrameSinkId& frame_sink_id) { |
| 124 bool inserted = valid_frame_sink_ids_.insert(frame_sink_id).second; | 124 valid_frame_sink_ids_.insert(frame_sink_id); |
|
boliu
2017/01/26 22:39:41
why drop this DCHECK? is client inserting duplicat
Alex Z.
2017/01/27 20:27:02
From fsamuel@'s comment:
ui::Compositor Registers
| |
| 125 DCHECK(inserted); | |
| 126 } | 125 } |
| 127 | 126 |
| 128 void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) { | 127 void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) { |
| 129 valid_frame_sink_ids_.erase(frame_sink_id); | 128 valid_frame_sink_ids_.erase(frame_sink_id); |
| 130 GarbageCollectSurfaces(); | 129 GarbageCollectSurfaces(); |
| 131 } | 130 } |
| 132 | 131 |
| 133 const SurfaceId& SurfaceManager::GetRootSurfaceId() const { | 132 const SurfaceId& SurfaceManager::GetRootSurfaceId() const { |
| 134 return root_surface_id_; | 133 return root_surface_id_; |
| 135 } | 134 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); | 625 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); |
| 627 std::sort(children.begin(), children.end()); | 626 std::sort(children.begin(), children.end()); |
| 628 | 627 |
| 629 for (const SurfaceId& child_id : children) | 628 for (const SurfaceId& child_id : children) |
| 630 SurfaceReferencesToStringImpl(child_id, indent + " ", str); | 629 SurfaceReferencesToStringImpl(child_id, indent + " ", str); |
| 631 } | 630 } |
| 632 } | 631 } |
| 633 #endif // DCHECK_IS_ON() | 632 #endif // DCHECK_IS_ON() |
| 634 | 633 |
| 635 } // namespace cc | 634 } // namespace cc |
| OLD | NEW |