Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: ui/compositor/compositor.cc

Issue 2425923003: Replaced is_null() with is_valid in SurfaceId and related classes. (Closed)
Patch Set: Removed added printf statements; LocalFrameId::is_valid() no longer checks if nonce is 0. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 host_->GetLayerTree()->animation_host()->RemoveAnimationTimeline( 227 host_->GetLayerTree()->animation_host()->RemoveAnimationTimeline(
228 animation_timeline_.get()); 228 animation_timeline_.get());
229 229
230 // Stop all outstanding draws before telling the ContextFactory to tear 230 // Stop all outstanding draws before telling the ContextFactory to tear
231 // down any contexts that the |host_| may rely upon. 231 // down any contexts that the |host_| may rely upon.
232 host_.reset(); 232 host_.reset();
233 233
234 context_factory_->RemoveCompositor(this); 234 context_factory_->RemoveCompositor(this);
235 auto* manager = context_factory_->GetSurfaceManager(); 235 auto* manager = context_factory_->GetSurfaceManager();
236 for (auto& client : child_frame_sinks_) { 236 for (auto& client : child_frame_sinks_) {
237 DCHECK(!client.is_null()); 237 DCHECK(client.is_valid());
238 manager->UnregisterFrameSinkHierarchy(frame_sink_id_, client); 238 manager->UnregisterFrameSinkHierarchy(frame_sink_id_, client);
239 } 239 }
240 manager->InvalidateFrameSinkId(frame_sink_id_); 240 manager->InvalidateFrameSinkId(frame_sink_id_);
241 } 241 }
242 242
243 void Compositor::AddFrameSink(const cc::FrameSinkId& frame_sink_id) { 243 void Compositor::AddFrameSink(const cc::FrameSinkId& frame_sink_id) {
244 context_factory_->GetSurfaceManager()->RegisterFrameSinkHierarchy( 244 context_factory_->GetSurfaceManager()->RegisterFrameSinkHierarchy(
245 frame_sink_id_, frame_sink_id); 245 frame_sink_id_, frame_sink_id);
246 child_frame_sinks_.insert(frame_sink_id); 246 child_frame_sinks_.insert(frame_sink_id);
247 } 247 }
248 248
249 void Compositor::RemoveFrameSink(const cc::FrameSinkId& frame_sink_id) { 249 void Compositor::RemoveFrameSink(const cc::FrameSinkId& frame_sink_id) {
250 auto it = child_frame_sinks_.find(frame_sink_id); 250 auto it = child_frame_sinks_.find(frame_sink_id);
251 DCHECK(it != child_frame_sinks_.end()); 251 DCHECK(it != child_frame_sinks_.end());
252 DCHECK(!it->is_null()); 252 DCHECK(it->is_valid());
253 context_factory_->GetSurfaceManager()->UnregisterFrameSinkHierarchy( 253 context_factory_->GetSurfaceManager()->UnregisterFrameSinkHierarchy(
254 frame_sink_id_, *it); 254 frame_sink_id_, *it);
255 child_frame_sinks_.erase(it); 255 child_frame_sinks_.erase(it);
256 } 256 }
257 257
258 void Compositor::SetCompositorFrameSink( 258 void Compositor::SetCompositorFrameSink(
259 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink) { 259 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink) {
260 compositor_frame_sink_requested_ = false; 260 compositor_frame_sink_requested_ = false;
261 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); 261 host_->SetCompositorFrameSink(std::move(compositor_frame_sink));
262 // Display properties are reset when the output surface is lost, so update it 262 // Display properties are reset when the output surface is lost, so update it
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 for (auto& observer : observer_list_) 540 for (auto& observer : observer_list_)
541 observer.OnCompositingLockStateChanged(this); 541 observer.OnCompositingLockStateChanged(this);
542 } 542 }
543 543
544 void Compositor::CancelCompositorLock() { 544 void Compositor::CancelCompositorLock() {
545 if (compositor_lock_) 545 if (compositor_lock_)
546 compositor_lock_->CancelLock(); 546 compositor_lock_->CancelLock();
547 } 547 }
548 548
549 } // namespace ui 549 } // namespace ui
OLDNEW
« cc/surfaces/local_frame_id.h ('K') | « ui/android/delegated_frame_host_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698