Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1128)

Unified Diff: content/renderer/render_widget.cc

Issue 10399020: Make RenderWidget send UpdateRect after auto-resize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 7d38cb2cddcb389efee24b3933b115a25e18c6cb..456d2cf261212a77a569f53a2e1bc245975ed496 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),
@@ -1077,7 +1078,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 +1153,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 +1168,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() {
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698