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

Unified Diff: remoting/base/encoder_row_based.cc

Issue 7622002: Revert 96327 - Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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/encoder_row_based.h ('k') | remoting/base/encoder_vp8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_row_based.cc
===================================================================
--- remoting/base/encoder_row_based.cc (revision 96327)
+++ remoting/base/encoder_row_based.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -66,19 +66,16 @@
capture_data_ = capture_data;
callback_.reset(data_available_callback);
- const SkRegion& region = capture_data->dirty_region();
- SkRegion::Iterator iter(region);
- while (!iter.done()) {
- SkIRect rect = iter.rect();
- iter.next();
- EncodeRect(rect, iter.done());
+ const InvalidRects& rects = capture_data->dirty_rects();
+ for (InvalidRects::const_iterator r = rects.begin(); r != rects.end(); ++r) {
+ EncodeRect(*r, r == --rects.end());
}
capture_data_ = NULL;
callback_.reset();
}
-void EncoderRowBased::EncodeRect(const SkIRect& rect, bool last) {
+void EncoderRowBased::EncodeRect(const gfx::Rect& rect, bool last) {
CHECK(capture_data_->data_planes().data[0]);
const int strides = capture_data_->data_planes().strides[0];
const int bytes_per_pixel = GetBytesPerPixel(capture_data_->pixel_format());
@@ -89,7 +86,7 @@
VideoPacket* packet = new VideoPacket();
PrepareUpdateStart(rect, packet);
const uint8* in = capture_data_->data_planes().data[0] +
- rect.fTop * strides + rect.fLeft * bytes_per_pixel;
+ rect.y() * strides + rect.x() * bytes_per_pixel;
// TODO(hclam): Fill in the sequence number.
uint8* out = GetOutputBuffer(packet, packet_size_);
int filled = 0;
@@ -145,13 +142,13 @@
}
}
-void EncoderRowBased::PrepareUpdateStart(const SkIRect& rect,
+void EncoderRowBased::PrepareUpdateStart(const gfx::Rect& rect,
VideoPacket* packet) {
packet->set_flags(packet->flags() | VideoPacket::FIRST_PACKET);
VideoPacketFormat* format = packet->mutable_format();
- format->set_x(rect.fLeft);
- format->set_y(rect.fTop);
+ format->set_x(rect.x());
+ format->set_y(rect.y());
format->set_width(rect.width());
format->set_height(rect.height());
format->set_encoding(encoding_);
« no previous file with comments | « remoting/base/encoder_row_based.h ('k') | remoting/base/encoder_vp8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698