summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 22:23:29 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 22:23:29 +0000
commite20e21cf6486ef399ca6d249210306a1d6e8cc5a (patch)
treea7a42478de051d97011721c90ca36d8b3c1a0c5a
parent353539b10270cbd21ef9510d383f80a05e5e66dc (diff)
downloadchromium_src-e20e21cf6486ef399ca6d249210306a1d6e8cc5a.zip
chromium_src-e20e21cf6486ef399ca6d249210306a1d6e8cc5a.tar.gz
chromium_src-e20e21cf6486ef399ca6d249210306a1d6e8cc5a.tar.bz2
Remove ViewMsg_UpdateRect_ACK
This was only used in the legacy software path. BUG=362164 Review URL: https://codereview.chromium.org/238293014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265381 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc48
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.h1
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.cc12
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.h5
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc5
-rw-r--r--content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc2
-rw-r--r--content/common/browser_plugin/browser_plugin_messages.h3
-rw-r--r--content/common/view_messages.h8
-rw-r--r--content/renderer/browser_plugin/browser_plugin.cc2
-rw-r--r--content/renderer/browser_plugin/browser_plugin_browsertest.cc2
-rw-r--r--content/renderer/render_widget.cc40
-rw-r--r--content/renderer/render_widget.h8
12 files changed, 3 insertions, 133 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index b947d72..89f4a6b 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -1431,12 +1431,8 @@ void BrowserPluginGuest::OnUnlockMouseAck(int instance_id) {
void BrowserPluginGuest::OnUpdateRectACK(
int instance_id,
- bool needs_ack,
const BrowserPluginHostMsg_AutoSize_Params& auto_size_params,
const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) {
- // Only the software path expects an ACK.
- if (needs_ack)
- Send(new ViewMsg_UpdateRect_ACK(routing_id()));
OnSetSize(instance_id_, auto_size_params, resize_guest_params);
}
@@ -1538,7 +1534,7 @@ void BrowserPluginGuest::OnUpdateRect(
relay_params.scale_factor = params.scale_factor;
relay_params.is_resize_ack = ViewHostMsg_UpdateRect_Flags::is_resize_ack(
params.flags);
- relay_params.needs_ack = params.needs_ack;
+ relay_params.needs_ack = false;
bool size_changed = last_seen_view_size_ != params.view_size;
gfx::Size old_size = last_seen_view_size_;
@@ -1550,47 +1546,7 @@ void BrowserPluginGuest::OnUpdateRect(
}
last_seen_auto_size_enabled_ = auto_size_enabled_;
- // HW accelerated case, acknowledge resize only
- if (!params.needs_ack || !damage_buffer_) {
- relay_params.damage_buffer_sequence_id = 0;
- SendMessageToEmbedder(
- new BrowserPluginMsg_UpdateRect(instance_id(), relay_params));
- return;
- }
-
- // Only copy damage if the guest is in autosize mode and the guest's view size
- // is less than the maximum size or the guest's view size is equal to the
- // damage buffer's size and the guest's scale factor is equal to the damage
- // buffer's scale factor.
- // The scaling change can happen due to asynchronous updates of the DPI on a
- // resolution change.
- if (((auto_size_enabled_ && InAutoSizeBounds(params.view_size)) ||
- (params.view_size == damage_view_size())) &&
- params.scale_factor == damage_buffer_scale_factor()) {
- TransportDIB* dib = GetWebContents()->GetRenderProcessHost()->
- GetTransportDIB(params.bitmap);
- if (dib) {
- size_t guest_damage_buffer_size =
-#if defined(OS_WIN)
- params.bitmap_rect.width() *
- params.bitmap_rect.height() * 4;
-#else
- dib->size();
-#endif
- size_t embedder_damage_buffer_size = damage_buffer_size_;
- void* guest_memory = dib->memory();
- void* embedder_memory = damage_buffer_->memory();
- size_t size = std::min(guest_damage_buffer_size,
- embedder_damage_buffer_size);
- memcpy(embedder_memory, guest_memory, size);
- }
- }
- relay_params.damage_buffer_sequence_id = damage_buffer_sequence_id_;
- relay_params.bitmap_rect = params.bitmap_rect;
- relay_params.scroll_delta = params.scroll_delta;
- relay_params.scroll_rect = params.scroll_rect;
- relay_params.copy_rects = params.copy_rects;
-
+ relay_params.damage_buffer_sequence_id = 0;
SendMessageToEmbedder(
new BrowserPluginMsg_UpdateRect(instance_id(), relay_params));
}
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index 7d4e520..4fc63db 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -431,7 +431,6 @@ class CONTENT_EXPORT BrowserPluginGuest
void OnUpdateGeometry(int instance_id, const gfx::Rect& view_rect);
void OnUpdateRectACK(
int instance_id,
- bool needs_ack,
const BrowserPluginHostMsg_AutoSize_Params& auto_size_params,
const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 2b3762f..0a8470c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -840,10 +840,6 @@ void RenderWidgetHostImpl::WaitForSurface() {
} while (max_delay > TimeDelta::FromSeconds(0));
}
-void RenderWidgetHostImpl::DonePaintingToBackingStore() {
- Send(new ViewMsg_UpdateRect_ACK(GetRoutingID()));
-}
-
bool RenderWidgetHostImpl::ScheduleComposite() {
if (is_hidden_ || !is_accelerated_compositing_active_ ||
current_size_.IsEmpty() || repaint_ack_pending_ ||
@@ -1628,14 +1624,6 @@ void RenderWidgetHostImpl::DidUpdateBackingStore(
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::DidUpdateBackingStore");
TimeTicks update_start = TimeTicks::Now();
- if (params.needs_ack) {
- // ACK early so we can prefetch the next PaintRect if there is a next one.
- // This must be done AFTER we're done painting with the bitmap supplied by
- // the renderer. This ACK is a signal to the renderer that the backing store
- // can be re-used, so the bitmap may be invalid after this call.
- Send(new ViewMsg_UpdateRect_ACK(routing_id_));
- }
-
// Move the plugins if the view hasn't already been destroyed. Plugin moves
// will not be re-issued, so must move them now, regardless of whether we
// paint or not. MovePluginWindows attempts to move the plugin windows and
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 1c8254d..42ed7db 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -257,11 +257,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
// blocking until the renderer sends a new frame.
void WaitForSurface();
- // When a backing store does asynchronous painting, it will call this function
- // when it is done with the DIB. We will then forward a message to the
- // renderer to send another paint.
- void DonePaintingToBackingStore();
-
// GPU accelerated version of GetBackingStore function. This will
// trigger a re-composite to the view. It may fail if a resize is pending, or
// if a composite has already been requested and not acked yet.
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 5ece26e..495dff1 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -407,7 +407,6 @@ void RenderWidgetHostProcess::InitUpdateRectParams(
params->copy_rects.push_back(params->bitmap_rect);
params->view_size = gfx::Size(w, h);
params->flags = update_msg_reply_flags_;
- params->needs_ack = true;
params->scale_factor = 1;
}
@@ -1057,10 +1056,6 @@ TEST_F(RenderWidgetHostTest, HiddenPaint) {
process_->InitUpdateRectParams(&params);
host_->OnUpdateRect(params);
- // It should have sent out the ACK.
- EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(
- ViewMsg_UpdateRect_ACK::ID));
-
// Now unhide.
process_->sink().ClearMessages();
host_->WasShown();
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
index c72dcb9..c3b9c35 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
@@ -86,7 +86,6 @@ class OverscrollNavigationOverlayTest : public RenderViewHostImplTestHarness {
params.view_size = gfx::Size(10, 10);
params.bitmap_rect = gfx::Rect(params.view_size);
params.scroll_rect = gfx::Rect();
- params.needs_ack = false;
ViewHostMsg_UpdateRect rect(test_rvh()->GetRoutingID(), params);
RenderViewHostTester::TestOnMessageReceived(test_rvh(), rect);
@@ -167,7 +166,6 @@ TEST_F(OverscrollNavigationOverlayTest, PaintUpdateWithoutNonEmptyPaint) {
params.view_size = gfx::Size(10, 10);
params.bitmap_rect = gfx::Rect(params.view_size);
params.scroll_rect = gfx::Rect();
- params.needs_ack = false;
params.flags = ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK;
ViewHostMsg_UpdateRect rect(test_rvh()->GetRoutingID(), params);
RenderViewHostTester::TestOnMessageReceived(test_rvh(), rect);
diff --git a/content/common/browser_plugin/browser_plugin_messages.h b/content/common/browser_plugin/browser_plugin_messages.h
index 50f1504..d84f3b8 100644
--- a/content/common/browser_plugin/browser_plugin_messages.h
+++ b/content/common/browser_plugin/browser_plugin_messages.h
@@ -206,9 +206,8 @@ IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent,
// the previous frame and is ready for the next frame. If the guest sent the
// embedder a bitmap that does not match the size of the BrowserPlugin's
// container, the BrowserPlugin requests a new size as well.
-IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_UpdateRect_ACK,
+IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK,
int /* instance_id */,
- bool /* needs_ack */,
BrowserPluginHostMsg_AutoSize_Params /* auto_size_params */,
BrowserPluginHostMsg_ResizeGuest_Params /* resize_guest_params */)
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index b1bf975..7210339 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -440,10 +440,6 @@ IPC_STRUCT_BEGIN(ViewHostMsg_UpdateRect_Params)
// request messages.
IPC_STRUCT_MEMBER(int, flags)
- // Whether or not the renderer expects a ViewMsg_UpdateRect_ACK for this
- // update. True for 2D painting, but false for accelerated compositing.
- IPC_STRUCT_MEMBER(bool, needs_ack)
-
// All the above coordinates are in DIP. This is the scale factor needed
// to convert them to pixels.
IPC_STRUCT_MEMBER(float, scale_factor)
@@ -637,10 +633,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_WasShown,
// exit if no other views are using it.
IPC_MESSAGE_ROUTED0(ViewMsg_WasSwappedOut)
-// Tells the render view that a ViewHostMsg_UpdateRect message was processed.
-// This signals the render view that it can send another UpdateRect message.
-IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK)
-
// Tells the renderer to focus the first (last if reverse is true) focusable
// node.
IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus,
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index b789ae9..b4cbebe 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -610,7 +610,6 @@ void BrowserPlugin::OnUpdateRect(
browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
render_view_routing_id_,
guest_instance_id_,
- true,
auto_size_params,
resize_guest_params));
return;
@@ -666,7 +665,6 @@ void BrowserPlugin::OnUpdateRect(
browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
render_view_routing_id_,
guest_instance_id_,
- UsesDamageBuffer(params),
auto_size_params,
resize_guest_params));
}
diff --git a/content/renderer/browser_plugin/browser_plugin_browsertest.cc b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
index 38fa884..f759b75 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -627,12 +627,10 @@ TEST_F(BrowserPluginTest, AutoSizeAttributes) {
ASSERT_TRUE(auto_size_msg);
int instance_id = 0;
- bool needs_ack = false;
BrowserPluginHostMsg_AutoSize_Params auto_size_params;
BrowserPluginHostMsg_ResizeGuest_Params resize_params;
BrowserPluginHostMsg_UpdateRect_ACK::Read(auto_size_msg,
&instance_id,
- &needs_ack,
&auto_size_params,
&resize_params);
EXPECT_FALSE(auto_size_params.enable);
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index b910e62..3ccbc66 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -355,12 +355,10 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
webwidget_(NULL),
opener_id_(MSG_ROUTING_NONE),
init_complete_(false),
- current_paint_buf_(NULL),
has_frame_pending_(false),
overdraw_bottom_height_(0.f),
next_paint_flags_(0),
filtered_time_per_frame_(0.0f),
- update_reply_pending_(false),
auto_resize_mode_(false),
need_update_rect_for_auto_resize_(false),
did_show_(false),
@@ -413,14 +411,6 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
RenderWidget::~RenderWidget() {
DCHECK(!webwidget_) << "Leaking our WebWidget!";
- if (current_paint_buf_) {
- if (RenderProcess::current()) {
- // If the RenderProcess is already gone, it will have released all DIBs
- // in its destructor anyway.
- RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_);
- }
- current_paint_buf_ = NULL;
- }
// If we are swapped out, we have released already.
if (!is_swapped_out_ && RenderProcess::current())
@@ -603,7 +593,6 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden)
IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown)
IPC_MESSAGE_HANDLER(ViewMsg_WasSwappedOut, OnWasSwappedOut)
- IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck)
IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive)
IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowShown, OnCandidateWindowShown)
IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowUpdated,
@@ -835,27 +824,6 @@ void RenderWidget::OnRequestMoveAck() {
pending_window_rect_count_--;
}
-void RenderWidget::OnUpdateRectAck() {
- TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck");
- DCHECK(update_reply_pending_);
- update_reply_pending_ = false;
-
- // If we sent an UpdateRect message with a zero-sized bitmap, then we should
- // have no current paint buffer.
- if (current_paint_buf_) {
- RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_);
- current_paint_buf_ = NULL;
- }
-
- // Notify subclasses that software rendering was flushed to the screen.
- if (!is_accelerated_compositing_active_) {
- DidFlushPaint();
- }
-
- // Continue painting if necessary...
- DoDeferredUpdateAndSendInputAck();
-}
-
GURL RenderWidget::GetURLForGraphicsContext3D() {
return GURL();
}
@@ -1389,8 +1357,6 @@ void RenderWidget::didInvalidateRect(const WebRect& rect) {
// We may not need to schedule another call to DoDeferredUpdate.
if (invalidation_task_posted_)
return;
- if (update_reply_pending_)
- return;
// When GPU rendering, combine pending animations and invalidations into
// a single update.
@@ -1427,8 +1393,6 @@ void RenderWidget::didScrollRect(int dx, int dy,
// We may not need to schedule another call to DoDeferredUpdate.
if (invalidation_task_posted_)
return;
- if (update_reply_pending_)
- return;
// When GPU rendering, combine pending animations and invalidations into
// a single update.
@@ -1583,9 +1547,6 @@ void RenderWidget::didCompleteSwapBuffers() {
// Notify subclasses threaded composited rendering was flushed to the screen.
DidFlushPaint();
- if (update_reply_pending_)
- return;
-
if (!next_paint_flags_ &&
!need_update_rect_for_auto_resize_ &&
!plugin_window_moves_.size()) {
@@ -1597,7 +1558,6 @@ void RenderWidget::didCompleteSwapBuffers() {
params.plugin_window_moves.swap(plugin_window_moves_);
params.flags = next_paint_flags_;
params.scroll_offset = GetScrollOffset();
- params.needs_ack = false;
params.scale_factor = device_scale_factor_;
Send(new ViewHostMsg_UpdateRect(routing_id_, params));
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index c37943f..22e12d6 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -352,7 +352,6 @@ class CONTENT_EXPORT RenderWidget
virtual void OnWasHidden();
virtual void OnWasShown(bool needs_repainting);
virtual void OnWasSwappedOut();
- void OnUpdateRectAck();
void OnCreateVideoAck(int32 video_id);
void OnUpdateVideoAck(int32 video_id);
void OnRequestMoveAck();
@@ -555,9 +554,6 @@ class CONTENT_EXPORT RenderWidget
// The size of the RenderWidget.
gfx::Size size_;
- // The TransportDIB that is being used to transfer an image to the browser.
- TransportDIB* current_paint_buf_;
-
bool has_frame_pending_;
// The size of the view's backing surface in non-DPI-adjusted pixels.
@@ -576,10 +572,6 @@ class CONTENT_EXPORT RenderWidget
// Filtered time per frame based on UpdateRect messages.
float filtered_time_per_frame_;
- // True if we are expecting an UpdateRect_ACK message (i.e., that a
- // UpdateRect message has been sent).
- bool update_reply_pending_;
-
// Whether the WebWidget is in auto resize mode, which is used for example
// by extension popups.
bool auto_resize_mode_;