summaryrefslogtreecommitdiffstats
path: root/remoting/client/rectangle_update_decoder.cc
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-29 03:45:17 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-29 03:45:17 +0000
commita9c88d1dec9f3532e16b8a7c80ff918a57e548c5 (patch)
tree0be954e8dc70f8c11e193f1ff6012ca731820852 /remoting/client/rectangle_update_decoder.cc
parentefcbe466225a33f01ec1d0ae6b65ff665cada2c5 (diff)
downloadchromium_src-a9c88d1dec9f3532e16b8a7c80ff918a57e548c5.zip
chromium_src-a9c88d1dec9f3532e16b8a7c80ff918a57e548c5.tar.gz
chromium_src-a9c88d1dec9f3532e16b8a7c80ff918a57e548c5.tar.bz2
Replace RectVectors with SkRegions in Decoder.
BUG=105401 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=118790 Review URL: http://codereview.chromium.org/9277001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/rectangle_update_decoder.cc')
-rw-r--r--remoting/client/rectangle_update_decoder.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc
index 3ce8b65..673c2a0 100644
--- a/remoting/client/rectangle_update_decoder.cc
+++ b/remoting/client/rectangle_update_decoder.cc
@@ -140,7 +140,7 @@ void RectangleUpdateDecoder::SetOutputSize(const SkISize& size) {
// TODO(wez): Refresh the frame only if the ratio has changed.
if (frame_) {
SkIRect frame_rect = SkIRect::MakeWH(frame_->width(), frame_->height());
- refresh_rects_.push_back(frame_rect);
+ refresh_region_.op(frame_rect, SkRegion::kUnion_Op);
}
// TODO(hclam): If the scale ratio has changed we should reallocate a
@@ -166,7 +166,7 @@ void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) {
// TODO(wez): Only refresh newly-exposed portions of the frame.
if (frame_) {
SkIRect frame_rect = SkIRect::MakeWH(frame_->width(), frame_->height());
- refresh_rects_.push_back(frame_rect);
+ refresh_region_.op(frame_rect, SkRegion::kUnion_Op);
}
clip_rect_ = new_clip_rect;
@@ -188,9 +188,9 @@ void RectangleUpdateDecoder::RefreshFullFrame() {
if (!frame_ || !decoder_.get())
return;
- refresh_rects_.push_back(
- SkIRect::MakeWH(static_cast<int>(frame_->width()),
- static_cast<int>(frame_->height())));
+ SkIRect frame_rect = SkIRect::MakeWH(frame_->width(), frame_->height());
+ refresh_region_.op(frame_rect, SkRegion::kUnion_Op);
+
DoRefresh();
}
@@ -200,33 +200,33 @@ void RectangleUpdateDecoder::SubmitToConsumer() {
if (!frame_)
return;
- RectVector* dirty_rects = new RectVector();
- decoder_->GetUpdatedRects(dirty_rects);
+ SkRegion* dirty_region = new SkRegion;
+ decoder_->GetUpdatedRegion(dirty_region);
- consumer_->OnPartialFrameOutput(frame_, dirty_rects, base::Bind(
- &RectangleUpdateDecoder::OnFrameConsumed, this, dirty_rects));
+ consumer_->OnPartialFrameOutput(frame_, dirty_region, base::Bind(
+ &RectangleUpdateDecoder::OnFrameConsumed, this, dirty_region));
}
void RectangleUpdateDecoder::DoRefresh() {
DCHECK(message_loop_->BelongsToCurrentThread());
- if (refresh_rects_.empty())
+ if (refresh_region_.isEmpty())
return;
- decoder_->RefreshRects(refresh_rects_);
- refresh_rects_.clear();
+ decoder_->RefreshRegion(refresh_region_);
+ refresh_region_.setEmpty();
SubmitToConsumer();
}
-void RectangleUpdateDecoder::OnFrameConsumed(RectVector* rects) {
+void RectangleUpdateDecoder::OnFrameConsumed(SkRegion* region) {
if (!message_loop_->BelongsToCurrentThread()) {
message_loop_->PostTask(
FROM_HERE, base::Bind(&RectangleUpdateDecoder::OnFrameConsumed,
- this, rects));
+ this, region));
return;
}
- delete rects;
+ delete region;
DoRefresh();
}