 Chromium Code Reviews
 Chromium Code Reviews Issue 1236663002:
  Allow shaped-desktop hosts to send shape only when it changes.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1236663002:
  Allow shaped-desktop hosts to send shape only when it changes.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 "remoting/client/software_video_renderer.h" | 5 #include "remoting/client/software_video_renderer.h" | 
| 6 | 6 | 
| 7 #include <list> | 7 #include <list> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/callback.h" | 10 #include "base/callback.h" | 
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 | 234 | 
| 235 // Draw the invalidated region to the buffer. | 235 // Draw the invalidated region to the buffer. | 
| 236 webrtc::DesktopFrame* buffer = buffers_.front(); | 236 webrtc::DesktopFrame* buffer = buffers_.front(); | 
| 237 webrtc::DesktopRegion output_region; | 237 webrtc::DesktopRegion output_region; | 
| 238 decoder_->RenderFrame(view_size_, clip_area_, | 238 decoder_->RenderFrame(view_size_, clip_area_, | 
| 239 buffer->data(), buffer->stride(), &output_region); | 239 buffer->data(), buffer->stride(), &output_region); | 
| 240 | 240 | 
| 241 // Notify the consumer that painting is done. | 241 // Notify the consumer that painting is done. | 
| 242 if (!output_region.is_empty()) { | 242 if (!output_region.is_empty()) { | 
| 243 buffers_.pop_front(); | 243 buffers_.pop_front(); | 
| 244 consumer_->ApplyBuffer(view_size_, clip_area_, buffer, output_region, | 244 consumer_->ApplyBuffer( | 
| 245 *decoder_->GetImageShape()); | 245 view_size_, clip_area_, buffer, output_region, | 
| 246 decoder_->GetImageShape() | |
| 
Sergey Ulanov
2015/07/10 21:51:43
Maybe fix FrameConsumer interface to take pointer
 
Wez
2015/07/13 19:56:24
Done.
As part of doing that I've also simplified
 | |
| 247 ? *decoder_->GetImageShape() | |
| 248 : webrtc::DesktopRegion( | |
| 249 webrtc::DesktopRect::MakeSize(source_size_))); | |
| 246 } | 250 } | 
| 247 } | 251 } | 
| 248 | 252 | 
| 249 void SoftwareVideoRenderer::Core::RequestReturnBuffers( | 253 void SoftwareVideoRenderer::Core::RequestReturnBuffers( | 
| 250 const base::Closure& done) { | 254 const base::Closure& done) { | 
| 251 DCHECK(decode_task_runner_->BelongsToCurrentThread()); | 255 DCHECK(decode_task_runner_->BelongsToCurrentThread()); | 
| 252 | 256 | 
| 253 while (!buffers_.empty()) { | 257 while (!buffers_.empty()) { | 
| 254 consumer_->ReturnBuffer(buffers_.front()); | 258 consumer_->ReturnBuffer(buffers_.front()); | 
| 255 buffers_.pop_front(); | 259 buffers_.pop_front(); | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 DCHECK(CalledOnValidThread()); | 425 DCHECK(CalledOnValidThread()); | 
| 422 | 426 | 
| 423 // Record the latency between the packet being received and presented. | 427 // Record the latency between the packet being received and presented. | 
| 424 stats_.video_decode_ms()->Record( | 428 stats_.video_decode_ms()->Record( | 
| 425 (base::Time::Now() - decode_start).InMilliseconds()); | 429 (base::Time::Now() - decode_start).InMilliseconds()); | 
| 426 | 430 | 
| 427 done.Run(); | 431 done.Run(); | 
| 428 } | 432 } | 
| 429 | 433 | 
| 430 } // namespace remoting | 434 } // namespace remoting | 
| OLD | NEW |