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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 std::vector<uint32_t>* sequence) { | 81 std::vector<uint32_t>* sequence) { |
82 DCHECK(thread_checker_.CalledOnValidThread()); | 82 DCHECK(thread_checker_.CalledOnValidThread()); |
83 DCHECK_EQ(lifetime_type_, LifetimeType::SEQUENCES); | 83 DCHECK_EQ(lifetime_type_, LifetimeType::SEQUENCES); |
84 for (uint32_t value : *sequence) | 84 for (uint32_t value : *sequence) |
85 satisfied_sequences_.insert(SurfaceSequence(frame_sink_id, value)); | 85 satisfied_sequences_.insert(SurfaceSequence(frame_sink_id, value)); |
86 sequence->clear(); | 86 sequence->clear(); |
87 GarbageCollectSurfaces(); | 87 GarbageCollectSurfaces(); |
88 } | 88 } |
89 | 89 |
90 void SurfaceManager::RegisterFrameSinkId(const FrameSinkId& frame_sink_id) { | 90 void SurfaceManager::RegisterFrameSinkId(const FrameSinkId& frame_sink_id) { |
91 bool inserted = valid_frame_sink_ids_.insert(frame_sink_id).second; | 91 valid_frame_sink_ids_.insert(frame_sink_id); |
92 DCHECK(inserted); | |
93 } | 92 } |
94 | 93 |
95 void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) { | 94 void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) { |
96 valid_frame_sink_ids_.erase(frame_sink_id); | 95 valid_frame_sink_ids_.erase(frame_sink_id); |
97 GarbageCollectSurfaces(); | 96 GarbageCollectSurfaces(); |
98 } | 97 } |
99 | 98 |
100 const SurfaceId& SurfaceManager::GetRootSurfaceId() const { | 99 const SurfaceId& SurfaceManager::GetRootSurfaceId() const { |
101 return root_surface_id_; | 100 return root_surface_id_; |
102 } | 101 } |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 return changed; | 494 return changed; |
496 } | 495 } |
497 | 496 |
498 void SurfaceManager::SurfaceCreated(const SurfaceInfo& surface_info) { | 497 void SurfaceManager::SurfaceCreated(const SurfaceInfo& surface_info) { |
499 CHECK(thread_checker_.CalledOnValidThread()); | 498 CHECK(thread_checker_.CalledOnValidThread()); |
500 for (auto& observer : observer_list_) | 499 for (auto& observer : observer_list_) |
501 observer.OnSurfaceCreated(surface_info); | 500 observer.OnSurfaceCreated(surface_info); |
502 } | 501 } |
503 | 502 |
504 } // namespace cc | 503 } // namespace cc |
OLD | NEW |