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

Side by Side Diff: cc/layers/video_frame_provider_client_impl.cc

Issue 2667383009: Revert of Mark Layer Damaged When The Client Is Gone (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | cc/layers/video_frame_provider_client_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/video_frame_provider_client_impl.h" 5 #include "cc/layers/video_frame_provider_client_impl.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/layers/video_layer_impl.h" 9 #include "cc/layers/video_layer_impl.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 client_->AddVideoFrameController(this); 120 client_->AddVideoFrameController(this);
121 } 121 }
122 122
123 void VideoFrameProviderClientImpl::StopRendering() { 123 void VideoFrameProviderClientImpl::StopRendering() {
124 DCHECK(thread_checker_.CalledOnValidThread()); 124 DCHECK(thread_checker_.CalledOnValidThread());
125 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StopRendering"); 125 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StopRendering");
126 DCHECK(rendering_); 126 DCHECK(rendering_);
127 DCHECK(!stopped_); 127 DCHECK(!stopped_);
128 client_->RemoveVideoFrameController(this); 128 client_->RemoveVideoFrameController(this);
129 rendering_ = false; 129 rendering_ = false;
130 if (active_video_layer_)
131 active_video_layer_->SetNeedsRedraw();
132 } 130 }
133 131
134 void VideoFrameProviderClientImpl::DidReceiveFrame() { 132 void VideoFrameProviderClientImpl::DidReceiveFrame() {
135 TRACE_EVENT1("cc", 133 TRACE_EVENT1("cc",
136 "VideoFrameProviderClientImpl::DidReceiveFrame", 134 "VideoFrameProviderClientImpl::DidReceiveFrame",
137 "active_video_layer", 135 "active_video_layer",
138 !!active_video_layer_); 136 !!active_video_layer_);
139 DCHECK(thread_checker_.CalledOnValidThread()); 137 DCHECK(thread_checker_.CalledOnValidThread());
140 needs_put_current_frame_ = true; 138 needs_put_current_frame_ = true;
141 if (active_video_layer_) 139 if (active_video_layer_)
(...skipping 27 matching lines...) Expand all
169 DCHECK(thread_checker_.CalledOnValidThread()); 167 DCHECK(thread_checker_.CalledOnValidThread());
170 { 168 {
171 base::AutoLock locker(provider_lock_); 169 base::AutoLock locker(provider_lock_);
172 if (provider_ && needs_put_current_frame_) 170 if (provider_ && needs_put_current_frame_)
173 provider_->PutCurrentFrame(); 171 provider_->PutCurrentFrame();
174 } 172 }
175 needs_put_current_frame_ = false; 173 needs_put_current_frame_ = false;
176 } 174 }
177 175
178 } // namespace cc 176 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/video_frame_provider_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698