diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 18:21:30 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 18:21:30 +0000 |
commit | 5738ca26099b7794bd2084814a26030e844b6f03 (patch) | |
tree | f0c7bc241def11da1a5b382363217f2e15645a5f /remoting | |
parent | cba890e40291c245a53ce4297619659458ce4138 (diff) | |
download | chromium_src-5738ca26099b7794bd2084814a26030e844b6f03.zip chromium_src-5738ca26099b7794bd2084814a26030e844b6f03.tar.gz chromium_src-5738ca26099b7794bd2084814a26030e844b6f03.tar.bz2 |
Fix Chromoting Client's handling of DidChangeView.
BUG=95699
TEST=Desktop should be correctly displayed when first connected.
Review URL: http://codereview.chromium.org/7864018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index b0d81cc..98c87d4 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -251,23 +251,21 @@ void ChromotingInstance::DidChangeView(const pp::Rect& position, const pp::Rect& clip) { DCHECK(plugin_message_loop_->BelongsToCurrentThread()); - bool size_changed = - view_->SetPluginSize(gfx::Size(position.width(), position.height())); + view_->SetPluginSize(gfx::Size(position.width(), position.height())); - // If scale to fit there is no clipping so just update the scale ratio. + // TODO(wez): Pass the dimensions of the plugin to the RectangleDecoder + // and let it generate the necessary refresh events. + // If scale-to-fit is enabled then update the scaling ratios. + // We also force a full-frame refresh, in case the ratios changed. if (scale_to_fit_) { rectangle_decoder_->SetScaleRatios(view_->GetHorizontalScaleRatio(), view_->GetVerticalScaleRatio()); - } - - if (size_changed) { - // If plugin size has changed there may be regions uncovered so simply - // request a full refresh. rectangle_decoder_->RefreshFullFrame(); - } else if (!scale_to_fit_) { - rectangle_decoder_->UpdateClipRect( - gfx::Rect(clip.x(), clip.y(), clip.width(), clip.height())); } + + // Notify the RectangleDecoder of the new clip rect. + rectangle_decoder_->UpdateClipRect( + gfx::Rect(clip.x(), clip.y(), clip.width(), clip.height())); } bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { @@ -374,6 +372,9 @@ void ChromotingInstance::SetScaleToFit(bool scale_to_fit) { } else { rectangle_decoder_->SetScaleRatios(1.0, 1.0); } + + // TODO(wez): The RectangleDecoder should generate refresh events + // as necessary in response to any scaling change. rectangle_decoder_->RefreshFullFrame(); } |