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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 948603002: Fix resize ACK bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); 584 resize_params->physical_backing_size = view_->GetPhysicalBackingSize();
585 resize_params->top_controls_height = view_->GetTopControlsHeight(); 585 resize_params->top_controls_height = view_->GetTopControlsHeight();
586 resize_params->top_controls_shrink_blink_size = 586 resize_params->top_controls_shrink_blink_size =
587 view_->DoTopControlsShrinkBlinkSize(); 587 view_->DoTopControlsShrinkBlinkSize();
588 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); 588 resize_params->visible_viewport_size = view_->GetVisibleViewportSize();
589 resize_params->is_fullscreen = IsFullscreen(); 589 resize_params->is_fullscreen = IsFullscreen();
590 } 590 }
591 591
592 const bool size_changed = 592 const bool size_changed =
593 !old_resize_params_ || 593 !old_resize_params_ ||
594 old_resize_params_->new_size != resize_params->new_size; 594 current_size_ != resize_params->new_size;
595 bool dirty = 595 bool dirty =
596 size_changed || screen_info_out_of_date_ || 596 size_changed || screen_info_out_of_date_ ||
597 old_resize_params_->physical_backing_size != 597 old_resize_params_->physical_backing_size !=
598 resize_params->physical_backing_size || 598 resize_params->physical_backing_size ||
599 old_resize_params_->is_fullscreen != resize_params->is_fullscreen || 599 old_resize_params_->is_fullscreen != resize_params->is_fullscreen ||
600 old_resize_params_->top_controls_height != 600 old_resize_params_->top_controls_height !=
601 resize_params->top_controls_height || 601 resize_params->top_controls_height ||
602 old_resize_params_->top_controls_shrink_blink_size != 602 old_resize_params_->top_controls_shrink_blink_size !=
603 resize_params->top_controls_shrink_blink_size || 603 resize_params->top_controls_shrink_blink_size ||
604 old_resize_params_->visible_viewport_size != 604 old_resize_params_->visible_viewport_size !=
(...skipping 26 matching lines...) Expand all
631 631
632 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params); 632 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params);
633 if (!GetResizeParams(params.get())) 633 if (!GetResizeParams(params.get()))
634 return; 634 return;
635 635
636 bool width_changed = 636 bool width_changed =
637 !old_resize_params_ || 637 !old_resize_params_ ||
638 old_resize_params_->new_size.width() != params->new_size.width(); 638 old_resize_params_->new_size.width() != params->new_size.width();
639 if (Send(new ViewMsg_Resize(routing_id_, *params))) { 639 if (Send(new ViewMsg_Resize(routing_id_, *params))) {
640 resize_ack_pending_ = params->needs_resize_ack; 640 resize_ack_pending_ = params->needs_resize_ack;
641 DCHECK_IMPLIES(params->new_size.IsEmpty(), !params->needs_resize_ack);
642 if (params->new_size.IsEmpty())
no sievers 2015/02/26 00:23:06 This is purely to make one of the tests happy whic
643 current_size_ = params->new_size;
641 old_resize_params_.swap(params); 644 old_resize_params_.swap(params);
642 } 645 }
643 646
644 if (delegate_) 647 if (delegate_)
645 delegate_->RenderWidgetWasResized(this, width_changed); 648 delegate_->RenderWidgetWasResized(this, width_changed);
646 } 649 }
647 650
648 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) { 651 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) {
649 Send(new ViewMsg_ChangeResizeRect(routing_id_, new_rect)); 652 Send(new ViewMsg_ChangeResizeRect(routing_id_, new_rect));
650 } 653 }
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 } 2194 }
2192 #endif 2195 #endif
2193 2196
2194 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2197 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2195 if (view_) 2198 if (view_)
2196 return view_->PreferredReadbackFormat(); 2199 return view_->PreferredReadbackFormat();
2197 return kN32_SkColorType; 2200 return kN32_SkColorType;
2198 } 2201 }
2199 2202
2200 } // namespace content 2203 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698