diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 03:43:09 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 03:43:09 +0000 |
commit | ea3ee0a8f3e4841e7e27dfc371c98a8b5dd5ca9a (patch) | |
tree | 54e731014f925718fd01d8495e029f04942a3953 /content | |
parent | 09b21196f2668fb0dc2ebc630add31ac4c3ea956 (diff) | |
download | chromium_src-ea3ee0a8f3e4841e7e27dfc371c98a8b5dd5ca9a.zip chromium_src-ea3ee0a8f3e4841e7e27dfc371c98a8b5dd5ca9a.tar.gz chromium_src-ea3ee0a8f3e4841e7e27dfc371c98a8b5dd5ca9a.tar.bz2 |
Make RenderWidget send UpdateRect after auto-resize.
This sets a flag in didAutoResize() that
didCompleteSwapBuffers() inspects when deciding whether to
send an UpdateRect message or not. Without this, extension
bubbles aren't getting resized correctly when using the
threaded compositor.
BUG=120247
TEST=manual: "Google Calendar (by Google)" and "Google +1 Button" extensions' bubbles resize to fit their content on Chrome OS
Review URL: https://chromiumcodereview.appspot.com/10399020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/renderer/render_widget.cc | 13 | ||||
-rw-r--r-- | content/renderer/render_widget.h | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 7d38cb2..164ebf6 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -84,6 +84,7 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type, next_paint_flags_(0), filtered_time_per_frame_(0.0f), update_reply_pending_(false), + need_update_rect_for_auto_resize_(false), using_asynchronous_swapbuffers_(false), num_swapbuffers_complete_pending_(0), did_show_(false), @@ -917,6 +918,7 @@ void RenderWidget::DoDeferredUpdate() { pending_update_params_->scroll_offset = GetScrollOffset(); pending_update_params_->needs_ack = true; next_paint_flags_ = 0; + need_update_rect_for_auto_resize_ = false; if (update.scroll_rect.IsEmpty() && !is_accelerated_compositing_active_ && @@ -1077,7 +1079,10 @@ void RenderWidget::didScrollRect(int dx, int dy, const WebRect& clip_rect) { } void RenderWidget::didAutoResize(const WebSize& new_size) { - size_ = new_size; + if (size_.width() != new_size.width || size_.height() != new_size.height) { + size_ = new_size; + need_update_rect_for_auto_resize_ = true; + } } void RenderWidget::didActivateCompositor(int input_handler_identifier) { @@ -1149,8 +1154,11 @@ void RenderWidget::didCompleteSwapBuffers() { if (update_reply_pending_) return; - if (!next_paint_flags_ && !plugin_window_moves_.size()) + if (!next_paint_flags_ && + !need_update_rect_for_auto_resize_ && + !plugin_window_moves_.size()) { return; + } ViewHostMsg_UpdateRect_Params params; params.view_size = size_; @@ -1161,6 +1169,7 @@ void RenderWidget::didCompleteSwapBuffers() { Send(new ViewHostMsg_UpdateRect(routing_id_, params)); next_paint_flags_ = 0; + need_update_rect_for_auto_resize_ = false; } void RenderWidget::scheduleComposite() { diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 00ea03c..ef49c15 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -411,6 +411,10 @@ class CONTENT_EXPORT RenderWidget // UpdateRect message has been sent). bool update_reply_pending_; + // True if we need to send an UpdateRect message to notify the browser about + // an already-completed auto-resize. + bool need_update_rect_for_auto_resize_; + // True if the underlying graphics context supports asynchronous swap. // Cached on the RenderWidget because determining support is costly. bool using_asynchronous_swapbuffers_; |