Commit a43612d3 authored by jamesr@chromium.org's avatar jamesr@chromium.org

Revert 204014 "Don't track whether a resize ack is pending durin..."

> 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
> 
> Review URL: https://chromiumcodereview.appspot.com/16285005

Breaks fast/hidpi on windows

TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/16326004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204038 0039d316-1c4b-4281-b951-d872f2087c98
parent 9394e934
......@@ -85,8 +85,6 @@ using WebKit::WebTextDirection;
namespace content {
namespace {
bool g_check_for_pending_resize_ack = true;
// How long to (synchronously) wait for the renderer to respond with a
// PaintRect message, when our backing-store is invalid, before giving up and
// returning a null or incorrectly sized backing-store from GetBackingStore.
......@@ -1217,11 +1215,6 @@ int64 RenderWidgetHostImpl::GetLatencyComponentId() {
return GetRoutingID() | (static_cast<int64>(GetProcess()->GetID()) << 32);
}
// static
void RenderWidgetHostImpl::DisableResizeAckCheckForTesting() {
g_check_for_pending_resize_ack = false;
}
ui::LatencyInfo RenderWidgetHostImpl::NewInputLatencyInfo() {
ui::LatencyInfo info;
info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_COMPONENT,
......@@ -1744,7 +1737,7 @@ void RenderWidgetHostImpl::OnUpdateRect(
// resize_ack_pending_ needs to be cleared before we call DidPaintRect, since
// that will end up reaching GetBackingStore.
if (is_resize_ack) {
DCHECK(!g_check_for_pending_resize_ack || resize_ack_pending_);
DCHECK(resize_ack_pending_);
resize_ack_pending_ = false;
in_flight_size_.SetSize(0, 0);
}
......
......@@ -486,9 +486,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
// subsystem.
int64 GetLatencyComponentId();
// Don't check whether we expected a resize ack during layout tests.
static void DisableResizeAckCheckForTesting();
protected:
virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE;
......
......@@ -373,13 +373,9 @@ void RenderWidget::Resize(const gfx::Size& new_size,
const gfx::Rect& resizer_rect,
bool is_fullscreen,
ResizeAck 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);
}
// 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_)
......@@ -416,8 +412,7 @@ 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 (!RenderThreadImpl::current() || // Will be NULL during unit tests.
!RenderThreadImpl::current()->layout_test_mode()) {
} else if (size_browser_expects_ == new_size) {
resize_ack = NO_RESIZE_ACK;
}
......@@ -474,6 +469,7 @@ 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) {
......@@ -543,6 +539,7 @@ 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.
......
......@@ -534,6 +534,12 @@ class CONTENT_EXPORT RenderWidget
// The size of the RenderWidget.
gfx::Size size_;
// When short-circuiting size updates, the browser might not know about the
// current size of the RenderWidget. To be able to correctly predict when the
// browser expects a resize ack, keep track of the size the browser thinks
// this RenderWidget should have.
gfx::Size size_browser_expects_;
// The TransportDIB that is being used to transfer an image to the browser.
TransportDIB* current_paint_buf_;
......
......@@ -19,7 +19,6 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/layouttest_support.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/shell.h"
#include "content/shell/webkit_test_controller.h"
......@@ -79,8 +78,6 @@ InProcessBrowserLayoutTest::~InProcessBrowserLayoutTest() {
}
void InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture() {
EnableBrowserLayoutTestMode();
base::FilePath src_dir;
ASSERT_TRUE(PathService::Get(DIR_LAYOUT_TESTS, &src_dir));
base::FilePath absolute_parent_dir = src_dir.Append(test_parent_dir_);
......
......@@ -6,7 +6,6 @@
#include "base/callback.h"
#include "base/lazy_instance.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/gpu/image_transport_surface.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
......@@ -70,7 +69,6 @@ void EnableBrowserLayoutTestMode() {
#elif defined(OS_WIN) && !defined(USE_AURA)
WebContentsDragWin::DisableDragDropForTesting();
#endif
RenderWidgetHostImpl::DisableResizeAckCheckForTesting();
}
int GetLocalSessionHistoryLength(RenderView* render_view) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment