diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 08:35:48 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 08:35:48 +0000 |
commit | 1c0008845c0fc41e5d4db76b045848a70da3ca27 (patch) | |
tree | 0dec51cbc23e777b68e722d07cf663bf06057dcc /content/renderer/render_widget.cc | |
parent | a1827ff67c77c8650938989c526a4b7e51a258aa (diff) | |
download | chromium_src-1c0008845c0fc41e5d4db76b045848a70da3ca27.zip chromium_src-1c0008845c0fc41e5d4db76b045848a70da3ca27.tar.gz chromium_src-1c0008845c0fc41e5d4db76b045848a70da3ca27.tar.bz2 |
Reland r204014 - Don't track whether a resize ack is pending during layout tests
Unlike normal operation, in layout tests the renderer can request a synchronous
change of its size. The renderer and the browser therefore often run out of
sync. However, it's important that the renderer always acks a resize request
from the browser.
Previously, I tried to track the size the browser expects the renderer to have
in the renderer, however, this turns out to not work when the compositor is in
hidpi mode. Instead of trying to fix this up somehow, just ignore whether or
not the browser is expecting resize acks during layout tests
BUG=244369
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/15878016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_widget.cc')
-rw-r--r-- | content/renderer/render_widget.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 35ed654..c9bd3f8 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -373,9 +373,13 @@ void RenderWidget::Resize(const gfx::Size& new_size, const gfx::Rect& resizer_rect, bool is_fullscreen, ResizeAck resize_ack) { - // A resize ack shouldn't be requested if we have not ACK'd the previous one. - DCHECK(resize_ack != SEND_RESIZE_ACK || !next_paint_is_resize_ack()); - DCHECK(resize_ack == SEND_RESIZE_ACK || resize_ack == NO_RESIZE_ACK); + if (!RenderThreadImpl::current() || // Will be NULL during unit tests. + !RenderThreadImpl::current()->layout_test_mode()) { + // A resize ack shouldn't be requested if we have not ACK'd the previous + // one. + DCHECK(resize_ack != SEND_RESIZE_ACK || !next_paint_is_resize_ack()); + DCHECK(resize_ack == SEND_RESIZE_ACK || resize_ack == NO_RESIZE_ACK); + } // Ignore this during shutdown. if (!webwidget_) @@ -412,7 +416,8 @@ void RenderWidget::Resize(const gfx::Size& new_size, // Resize should have caused an invalidation of the entire view. DCHECK(new_size.IsEmpty() || is_accelerated_compositing_active_ || paint_aggregator_.HasPendingUpdate()); - } else if (size_browser_expects_ == new_size) { + } else if (!RenderThreadImpl::current() || // Will be NULL during unit tests. + !RenderThreadImpl::current()->layout_test_mode()) { resize_ack = NO_RESIZE_ACK; } @@ -469,7 +474,6 @@ void RenderWidget::OnResize(const ViewMsg_Resize_Params& params) { Resize(params.new_size, params.physical_backing_size, params.overdraw_bottom_height, params.resizer_rect, params.is_fullscreen, SEND_RESIZE_ACK); - size_browser_expects_ = params.new_size; } void RenderWidget::OnChangeResizeRect(const gfx::Rect& resizer_rect) { @@ -539,7 +543,6 @@ void RenderWidget::OnUpdateRectAck() { TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); DCHECK(update_reply_pending_); update_reply_pending_ = false; - size_browser_expects_ = size_; // If we sent an UpdateRect message with a zero-sized bitmap, then we should // have no current paint buffer. |