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

Unified Diff: remoting/client/rectangle_update_decoder.cc

Issue 8954003: Revised sub-rectangle scaling for use in Chromoting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace bounds-check on loop with a DCHECK. Created 9 years 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
« media/base/yuv_convert.h ('K') | « remoting/client/rectangle_update_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/rectangle_update_decoder.cc
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc
index 9e09d7f70364d0c998b02fc4f8995faf417db102..982a5766e1775d72e1adacf3fdaf716427ba8bc3 100644
--- a/remoting/client/rectangle_update_decoder.cc
+++ b/remoting/client/rectangle_update_decoder.cc
@@ -138,10 +138,20 @@ void RectangleUpdateDecoder::SetScaleRatios(double horizontal_ratio,
return;
}
+ // 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);
+ }
+
// TODO(hclam): If the scale ratio has changed we should reallocate a
// VideoFrame of different size. However if the scale ratio is always
// smaller than 1.0 we can use the same video frame.
decoder_->SetScaleRatios(horizontal_ratio, vertical_ratio);
+
+ // TODO(wez): Defer refresh, so that resize, which will affect both scale
+ // factor and clip rect, doesn't lead to unnecessary refreshes.
+ DoRefresh();
}
void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) {
@@ -155,6 +165,15 @@ void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) {
if (new_clip_rect == clip_rect_ || !decoder_.get())
return;
+ // 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);
+ }
+
+#if 0
+ // TODO(wez): Fix this code to account for scaling.
+
// Find out the rectangles to show because of clip rect is updated.
if (new_clip_rect.fTop < clip_rect_.fTop) {
refresh_rects_.push_back(
@@ -187,9 +206,12 @@ void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) {
new_clip_rect.width(),
new_clip_rect.fBottom - clip_rect_.fBottom));
}
+#endif
clip_rect_ = new_clip_rect;
decoder_->SetClipRect(new_clip_rect);
+
+ // TODO(wez): Defer refresh so that multiple events can be batched.
DoRefresh();
}
« media/base/yuv_convert.h ('K') | « remoting/client/rectangle_update_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698