summaryrefslogtreecommitdiffstats
path: root/remoting/base/encoder_verbatim.cc
diff options
context:
space:
mode:
authorgarykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 22:50:00 +0000
committergarykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 22:50:00 +0000
commit88552a9c89b99b93211ac5e679a0c13420e294db (patch)
treebe326ad62f7c9c9b3dfdea155a306005af00356a /remoting/base/encoder_verbatim.cc
parentce3b22e8da4fa9ca838423bacd54e45c3030d518 (diff)
downloadchromium_src-88552a9c89b99b93211ac5e679a0c13420e294db.zip
chromium_src-88552a9c89b99b93211ac5e679a0c13420e294db.tar.gz
chromium_src-88552a9c89b99b93211ac5e679a0c13420e294db.tar.bz2
Initial pass at integrating Differ into the chromoting host code.
BUG=none TEST=run Win host; x11 client Review URL: http://codereview.chromium.org/3013015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/encoder_verbatim.cc')
-rw-r--r--remoting/base/encoder_verbatim.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/remoting/base/encoder_verbatim.cc b/remoting/base/encoder_verbatim.cc
index 7f39f27..6a5a7d6 100644
--- a/remoting/base/encoder_verbatim.cc
+++ b/remoting/base/encoder_verbatim.cc
@@ -17,9 +17,12 @@ using media::DataBuffer;
void EncoderVerbatim::Encode(scoped_refptr<CaptureData> capture_data,
bool key_frame,
DataAvailableCallback* data_available_callback) {
- int num_rects = capture_data->dirty_rects().size();
- for (int i = 0; i < num_rects; i++) {
- const gfx::Rect& dirty_rect = capture_data->dirty_rects()[i];
+ const InvalidRects& rects = capture_data->dirty_rects();
+ int num_rects = rects.size();
+ int index = 0;
+ for (InvalidRects::const_iterator r = rects.begin();
+ r != rects.end(); ++r, ++index) {
+ const gfx::Rect& dirty_rect = *r;
HostMessage* msg = new HostMessage();
UpdateStreamPacketMessage* packet = msg->mutable_update_stream_packet();
@@ -29,10 +32,10 @@ void EncoderVerbatim::Encode(scoped_refptr<CaptureData> capture_data,
packet->mutable_end_rect();
EncodingState state = EncodingInProgress;
- if (i == 0) {
+ if (index == 0) {
state |= EncodingStarting;
}
- if (i == num_rects - 1) {
+ if (index == num_rects - 1) {
state |= EncodingEnded;
}
data_available_callback->Run(msg, state);