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

Side by Side Diff: remoting/host/capturer.cc

Issue 3305001: Move decoder into separate thread, clean up API layering, and redo update protocl (Closed)
Patch Set: Fix compile error. Created 10 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
« no previous file with comments | « remoting/client/x11_view.cc ('k') | remoting/host/chromoting_host.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/host/capturer.h" 5 #include "remoting/host/capturer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "remoting/base/tracer.h"
10
9 namespace remoting { 11 namespace remoting {
10 12
11 Capturer::Capturer() 13 Capturer::Capturer()
12 : width_(0), 14 : width_(0),
13 height_(0), 15 height_(0),
14 pixel_format_(PixelFormatInvalid), 16 pixel_format_(PixelFormatInvalid),
15 bytes_per_row_(0), 17 bytes_per_row_(0),
16 current_buffer_(0) { 18 current_buffer_(0) {
17 } 19 }
18 20
(...skipping 17 matching lines...) Expand all
36 } 38 }
37 39
38 void Capturer::InvalidateFullScreen() { 40 void Capturer::InvalidateFullScreen() {
39 AutoLock auto_inval_rects_lock(inval_rects_lock_); 41 AutoLock auto_inval_rects_lock(inval_rects_lock_);
40 inval_rects_.clear(); 42 inval_rects_.clear();
41 inval_rects_.insert(gfx::Rect(0, 0, width_, height_)); 43 inval_rects_.insert(gfx::Rect(0, 0, width_, height_));
42 } 44 }
43 45
44 void Capturer::CaptureInvalidRects(CaptureCompletedCallback* callback) { 46 void Capturer::CaptureInvalidRects(CaptureCompletedCallback* callback) {
45 // Calculate which rects need to be captured. 47 // Calculate which rects need to be captured.
48 TraceContext::tracer()->PrintString("Started CalculateInvalidRects");
46 CalculateInvalidRects(); 49 CalculateInvalidRects();
50 TraceContext::tracer()->PrintString("Done CalculateInvalidRects");
47 51
48 // Braced to scope the lock. 52 // Braced to scope the lock.
49 InvalidRects local_rects; 53 InvalidRects local_rects;
50 { 54 {
51 AutoLock auto_inval_rects_lock(inval_rects_lock_); 55 AutoLock auto_inval_rects_lock(inval_rects_lock_);
52 local_rects = inval_rects_; 56 local_rects.swap(inval_rects_);
53 inval_rects_.clear();
54 } 57 }
55 58
59 TraceContext::tracer()->PrintString("Start CaptureRects");
56 CaptureRects(local_rects, callback); 60 CaptureRects(local_rects, callback);
57 } 61 }
58 62
59 void Capturer::FinishCapture(scoped_refptr<CaptureData> data, 63 void Capturer::FinishCapture(scoped_refptr<CaptureData> data,
60 CaptureCompletedCallback* callback) { 64 CaptureCompletedCallback* callback) {
61 // Select the next buffer to be the current buffer. 65 // Select the next buffer to be the current buffer.
62 current_buffer_ = (current_buffer_ + 1) % kNumBuffers; 66 current_buffer_ = (current_buffer_ + 1) % kNumBuffers;
63 67
64 callback->Run(data); 68 callback->Run(data);
65 delete callback; 69 delete callback;
66 } 70 }
67 71
68 } // namespace remoting 72 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/x11_view.cc ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698