| 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();
|
| }
|
|
|
|
|