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

Unified Diff: remoting/base/encoder_verbatim.cc

Issue 3013015: Initial pass at integrating Differ into the chromoting host code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/codec_test.cc ('k') | remoting/base/encoder_zlib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_verbatim.cc
===================================================================
--- remoting/base/encoder_verbatim.cc (revision 55264)
+++ remoting/base/encoder_verbatim.cc (working copy)
@@ -17,9 +17,12 @@
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 @@
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);
« no previous file with comments | « remoting/base/codec_test.cc ('k') | remoting/base/encoder_zlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698