summaryrefslogtreecommitdiffstats
path: root/content/browser/compositor
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-21 02:09:42 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-21 02:09:42 +0000
commita131f5300cacb9d6b24c8e2ef9955c2e06666713 (patch)
treeac7d9a17768fe2def84061df3cf6010bfd09c84e /content/browser/compositor
parentbb7db6ba5e1d1ad25a22adcb74e02c2a6c50b2bc (diff)
downloadchromium_src-a131f5300cacb9d6b24c8e2ef9955c2e06666713.zip
chromium_src-a131f5300cacb9d6b24c8e2ef9955c2e06666713.tar.gz
chromium_src-a131f5300cacb9d6b24c8e2ef9955c2e06666713.tar.bz2
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
Diffstat (limited to 'content/browser/compositor')
-rw-r--r--content/browser/compositor/delegated_frame_host.cc22
-rw-r--r--content/browser/compositor/delegated_frame_host.h4
2 files changed, 12 insertions, 14 deletions
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;