From a131f5300cacb9d6b24c8e2ef9955c2e06666713 Mon Sep 17 00:00:00 2001 From: "piman@chromium.org" Date: Wed, 21 May 2014 02:09:42 +0000 Subject: Fix virtual keyboard. Virtual keyboard starts with a height of 0, which makes us wait for a frame at that size which will never come. RWHI will skip the resizes for this, hence will not throttle the next (correct) size, which will come in but then be discarded. Make sure not to create a resize lock for empty sizes. BUG=374196 Review URL: https://codereview.chromium.org/284413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271813 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/compositor/delegated_frame_host.cc | 22 +++++++++++----------- content/browser/compositor/delegated_frame_host.h | 4 +--- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'content/browser/compositor') diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc index 229d190..a7207ea 100644 --- a/content/browser/compositor/delegated_frame_host.cc +++ b/content/browser/compositor/delegated_frame_host.cc @@ -25,7 +25,17 @@ namespace content { // DelegatedFrameHostClient bool DelegatedFrameHostClient::ShouldCreateResizeLock() { + // On Windows and Linux, holding pointer moves will not help throttling + // resizes. + // TODO(piman): on Windows we need to block (nested message loop?) the + // WM_SIZE event. On Linux we need to throttle at the WM level using + // _NET_WM_SYNC_REQUEST. + // TODO(ccameron): Mac browser window resizing is incompletely implemented. +#if !defined(OS_CHROMEOS) + return false; +#else return GetDelegatedFrameHost()->ShouldCreateResizeLock(); +#endif } void DelegatedFrameHostClient::RequestCopyOfOutput( @@ -82,15 +92,6 @@ void DelegatedFrameHost::MaybeCreateResizeLock() { } bool DelegatedFrameHost::ShouldCreateResizeLock() { - // On Windows and Linux, holding pointer moves will not help throttling - // resizes. - // TODO(piman): on Windows we need to block (nested message loop?) the - // WM_SIZE event. On Linux we need to throttle at the WM level using - // _NET_WM_SYNC_REQUEST. - // TODO(ccameron): Mac browser window resizing is incompletely implemented. -#if !defined(OS_CHROMEOS) - return false; -#else RenderWidgetHostImpl* host = client_->GetHost(); if (resize_lock_) @@ -100,7 +101,7 @@ bool DelegatedFrameHost::ShouldCreateResizeLock() { return false; gfx::Size desired_size = client_->DesiredFrameSize(); - if (desired_size == current_frame_size_in_dip_) + if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) return false; ui::Compositor* compositor = client_->GetCompositor(); @@ -108,7 +109,6 @@ bool DelegatedFrameHost::ShouldCreateResizeLock() { return false; return true; -#endif } void DelegatedFrameHost::RequestCopyOfOutput( diff --git a/content/browser/compositor/delegated_frame_host.h b/content/browser/compositor/delegated_frame_host.h index 6cf8026..f4f0b3f 100644 --- a/content/browser/compositor/delegated_frame_host.h +++ b/content/browser/compositor/delegated_frame_host.h @@ -109,12 +109,10 @@ class CONTENT_EXPORT DelegatedFrameHost cc::DelegatedFrameProvider* FrameProviderForTesting() const { return frame_provider_.get(); } - gfx::Size CurrentFrameSizeInDIPForTesting() const { - return current_frame_size_in_dip_; - } void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { OnCompositingDidCommit(compositor); } + bool ShouldCreateResizeLockForTesting() { return ShouldCreateResizeLock(); } private: friend class DelegatedFrameHostClient; -- cgit v1.1