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

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

Issue 1113283002: cc: Send BeginFrame to VideoFrameController when added if we're inside a frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. Created 5 years, 7 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/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 provider_ = nullptr; 111 provider_ = nullptr;
112 if (rendering_) 112 if (rendering_)
113 StopRendering(); 113 StopRendering();
114 } 114 }
115 115
116 void VideoFrameProviderClientImpl::StartRendering() { 116 void VideoFrameProviderClientImpl::StartRendering() {
117 DCHECK(thread_checker_.CalledOnValidThread()); 117 DCHECK(thread_checker_.CalledOnValidThread());
118 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StartRendering"); 118 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StartRendering");
119 DCHECK(!rendering_); 119 DCHECK(!rendering_);
120 DCHECK(!stopped_); 120 DCHECK(!stopped_);
121 rendering_ = true;
121 client_->AddVideoFrameController(this); 122 client_->AddVideoFrameController(this);
122 rendering_ = true;
123 } 123 }
124 124
125 void VideoFrameProviderClientImpl::StopRendering() { 125 void VideoFrameProviderClientImpl::StopRendering() {
126 DCHECK(thread_checker_.CalledOnValidThread()); 126 DCHECK(thread_checker_.CalledOnValidThread());
127 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StopRendering"); 127 TRACE_EVENT0("cc", "VideoFrameProviderClientImpl::StopRendering");
128 DCHECK(rendering_); 128 DCHECK(rendering_);
129 DCHECK(!stopped_); 129 DCHECK(!stopped_);
130 client_->RemoveVideoFrameController(this); 130 client_->RemoveVideoFrameController(this);
131 rendering_ = false; 131 rendering_ = false;
132 } 132 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (!provider_ || 165 if (!provider_ ||
166 !provider_->UpdateCurrentFrame(args.frame_time + args.interval, 166 !provider_->UpdateCurrentFrame(args.frame_time + args.interval,
167 args.frame_time + 2 * args.interval)) { 167 args.frame_time + 2 * args.interval)) {
168 return; 168 return;
169 } 169 }
170 170
171 DidReceiveFrame(); 171 DidReceiveFrame();
172 } 172 }
173 173
174 } // namespace cc 174 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698