Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 routing_id_(routing_id), | 148 routing_id_(routing_id), |
| 149 surface_id_(0), | 149 surface_id_(0), |
| 150 is_loading_(false), | 150 is_loading_(false), |
| 151 is_hidden_(false), | 151 is_hidden_(false), |
| 152 is_fullscreen_(false), | 152 is_fullscreen_(false), |
| 153 is_accelerated_compositing_active_(false), | 153 is_accelerated_compositing_active_(false), |
| 154 repaint_ack_pending_(false), | 154 repaint_ack_pending_(false), |
| 155 resize_ack_pending_(false), | 155 resize_ack_pending_(false), |
| 156 screen_info_out_of_date_(false), | 156 screen_info_out_of_date_(false), |
| 157 overdraw_bottom_height_(0.f), | 157 overdraw_bottom_height_(0.f), |
| 158 in_flight_size_(-1, -1), | |
| 158 should_auto_resize_(false), | 159 should_auto_resize_(false), |
| 159 waiting_for_screen_rects_ack_(false), | 160 waiting_for_screen_rects_ack_(false), |
| 160 mouse_move_pending_(false), | 161 mouse_move_pending_(false), |
| 161 mouse_wheel_pending_(false), | 162 mouse_wheel_pending_(false), |
| 162 accessibility_mode_(AccessibilityModeOff), | 163 accessibility_mode_(AccessibilityModeOff), |
| 163 select_range_pending_(false), | 164 select_range_pending_(false), |
| 164 move_caret_pending_(false), | 165 move_caret_pending_(false), |
| 165 needs_repainting_on_restore_(false), | 166 needs_repainting_on_restore_(false), |
| 166 is_unresponsive_(false), | 167 is_unresponsive_(false), |
| 167 in_flight_event_count_(0), | 168 in_flight_event_count_(0), |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 process_->SurfaceUpdated(surface_id_); | 355 process_->SurfaceUpdated(surface_id_); |
| 355 } | 356 } |
| 356 | 357 |
| 357 void RenderWidgetHostImpl::ResetSizeAndRepaintPendingFlags() { | 358 void RenderWidgetHostImpl::ResetSizeAndRepaintPendingFlags() { |
| 358 resize_ack_pending_ = false; | 359 resize_ack_pending_ = false; |
| 359 if (repaint_ack_pending_) { | 360 if (repaint_ack_pending_) { |
| 360 TRACE_EVENT_ASYNC_END0( | 361 TRACE_EVENT_ASYNC_END0( |
| 361 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); | 362 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); |
| 362 } | 363 } |
| 363 repaint_ack_pending_ = false; | 364 repaint_ack_pending_ = false; |
| 364 in_flight_size_.SetSize(0, 0); | 365 in_flight_size_.SetSize(-1, -1); |
| 365 } | 366 } |
| 366 | 367 |
| 367 void RenderWidgetHostImpl::SendScreenRects() { | 368 void RenderWidgetHostImpl::SendScreenRects() { |
| 368 if (!renderer_initialized_ || waiting_for_screen_rects_ack_) | 369 if (!renderer_initialized_ || waiting_for_screen_rects_ack_) |
| 369 return; | 370 return; |
| 370 | 371 |
| 371 if (is_hidden_) { | 372 if (is_hidden_) { |
| 372 // On GTK, this comes in for backgrounded tabs. Ignore, to match what | 373 // On GTK, this comes in for backgrounded tabs. Ignore, to match what |
| 373 // happens on Win & Mac, and when the view is shown it'll call this again. | 374 // happens on Win & Mac, and when the view is shown it'll call this again. |
| 374 return; | 375 return; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 gfx::Rect view_bounds = view_->GetViewBounds(); | 585 gfx::Rect view_bounds = view_->GetViewBounds(); |
| 585 gfx::Size new_size(view_bounds.size()); | 586 gfx::Size new_size(view_bounds.size()); |
| 586 | 587 |
| 587 gfx::Size old_physical_backing_size = physical_backing_size_; | 588 gfx::Size old_physical_backing_size = physical_backing_size_; |
| 588 physical_backing_size_ = view_->GetPhysicalBackingSize(); | 589 physical_backing_size_ = view_->GetPhysicalBackingSize(); |
| 589 bool was_fullscreen = is_fullscreen_; | 590 bool was_fullscreen = is_fullscreen_; |
| 590 is_fullscreen_ = IsFullscreen(); | 591 is_fullscreen_ = IsFullscreen(); |
| 591 float old_overdraw_bottom_height = overdraw_bottom_height_; | 592 float old_overdraw_bottom_height = overdraw_bottom_height_; |
| 592 overdraw_bottom_height_ = view_->GetOverdrawBottomHeight(); | 593 overdraw_bottom_height_ = view_->GetOverdrawBottomHeight(); |
| 593 | 594 |
| 594 bool size_changed = new_size != current_size_; | 595 bool size_changed = new_size != in_flight_size_; |
|
aelias_OOO_until_Jul13
2013/07/10 23:20:46
Leave this line as it was.
Kibeom Kim (inactive)
2013/07/11 00:23:51
Done.
| |
| 595 bool side_payload_changed = | 596 bool side_payload_changed = |
| 596 screen_info_out_of_date_ || | 597 screen_info_out_of_date_ || |
| 597 old_physical_backing_size != physical_backing_size_ || | 598 old_physical_backing_size != physical_backing_size_ || |
| 598 was_fullscreen != is_fullscreen_ || | 599 was_fullscreen != is_fullscreen_ || |
| 599 old_overdraw_bottom_height != overdraw_bottom_height_; | 600 old_overdraw_bottom_height != overdraw_bottom_height_; |
| 600 | 601 |
| 601 if (!size_changed && !side_payload_changed) | 602 if (!size_changed && !side_payload_changed) |
| 602 return; | 603 return; |
| 603 | 604 |
| 604 if (in_flight_size_ != gfx::Size() && new_size == in_flight_size_ && | |
|
aelias_OOO_until_Jul13
2013/07/10 23:20:46
Bring this back but just remove "in_flight_size_ !
Kibeom Kim (inactive)
2013/07/11 00:23:51
Done.
| |
| 605 !side_payload_changed) | |
| 606 return; | |
| 607 | |
| 608 if (!screen_info_) { | 605 if (!screen_info_) { |
| 609 screen_info_.reset(new WebKit::WebScreenInfo); | 606 screen_info_.reset(new WebKit::WebScreenInfo); |
| 610 GetWebScreenInfo(screen_info_.get()); | 607 GetWebScreenInfo(screen_info_.get()); |
| 611 } | 608 } |
| 612 | 609 |
| 613 // We don't expect to receive an ACK when the requested size or the physical | 610 // We don't expect to receive an ACK when the requested size or the physical |
| 614 // backing size is empty, or when the main viewport size didn't change. | 611 // backing size is empty, or when the main viewport size didn't change. |
| 615 if (!new_size.IsEmpty() && !physical_backing_size_.IsEmpty() && size_changed) | 612 if (!new_size.IsEmpty() && !physical_backing_size_.IsEmpty() && size_changed) |
| 616 resize_ack_pending_ = g_check_for_pending_resize_ack; | 613 resize_ack_pending_ = g_check_for_pending_resize_ack; |
| 617 | 614 |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1840 last_scroll_offset_ = params.scroll_offset; | 1837 last_scroll_offset_ = params.scroll_offset; |
| 1841 | 1838 |
| 1842 bool is_resize_ack = | 1839 bool is_resize_ack = |
| 1843 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); | 1840 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); |
| 1844 | 1841 |
| 1845 // resize_ack_pending_ needs to be cleared before we call DidPaintRect, since | 1842 // resize_ack_pending_ needs to be cleared before we call DidPaintRect, since |
| 1846 // that will end up reaching GetBackingStore. | 1843 // that will end up reaching GetBackingStore. |
| 1847 if (is_resize_ack) { | 1844 if (is_resize_ack) { |
| 1848 DCHECK(!g_check_for_pending_resize_ack || resize_ack_pending_); | 1845 DCHECK(!g_check_for_pending_resize_ack || resize_ack_pending_); |
| 1849 resize_ack_pending_ = false; | 1846 resize_ack_pending_ = false; |
| 1850 in_flight_size_.SetSize(0, 0); | |
|
aelias_OOO_until_Jul13
2013/07/10 23:20:46
Bring this back as "in_flight_size_.SetSize(-1, -1
Kibeom Kim (inactive)
2013/07/11 00:23:51
Done.
| |
| 1851 } | 1847 } |
| 1852 | 1848 |
| 1853 bool is_repaint_ack = | 1849 bool is_repaint_ack = |
| 1854 ViewHostMsg_UpdateRect_Flags::is_repaint_ack(params.flags); | 1850 ViewHostMsg_UpdateRect_Flags::is_repaint_ack(params.flags); |
| 1855 if (is_repaint_ack) { | 1851 if (is_repaint_ack) { |
| 1856 DCHECK(repaint_ack_pending_); | 1852 DCHECK(repaint_ack_pending_); |
| 1857 TRACE_EVENT_ASYNC_END0( | 1853 TRACE_EVENT_ASYNC_END0( |
| 1858 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); | 1854 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); |
| 1859 repaint_ack_pending_ = false; | 1855 repaint_ack_pending_ = false; |
| 1860 TimeDelta delta = TimeTicks::Now() - repaint_start_time_; | 1856 TimeDelta delta = TimeTicks::Now() - repaint_start_time_; |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2692 int process_id = (b->first.second >> 32) & 0xffffffff; | 2688 int process_id = (b->first.second >> 32) & 0xffffffff; |
| 2693 RenderWidgetHost* rwh = | 2689 RenderWidgetHost* rwh = |
| 2694 RenderWidgetHost::FromID(process_id, routing_id); | 2690 RenderWidgetHost::FromID(process_id, routing_id); |
| 2695 if (!rwh) | 2691 if (!rwh) |
| 2696 continue; | 2692 continue; |
| 2697 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); | 2693 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); |
| 2698 } | 2694 } |
| 2699 } | 2695 } |
| 2700 | 2696 |
| 2701 } // namespace content | 2697 } // namespace content |
| OLD | NEW |