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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 | 594 |
| 595 gfx::Rect view_bounds = view_->GetViewBounds(); | 595 gfx::Rect view_bounds = view_->GetViewBounds(); |
| 596 gfx::Size new_size(view_bounds.size()); | 596 gfx::Size new_size(view_bounds.size()); |
| 597 | 597 |
| 598 gfx::Size old_physical_backing_size = physical_backing_size_; | 598 gfx::Size old_physical_backing_size = physical_backing_size_; |
| 599 physical_backing_size_ = view_->GetPhysicalBackingSize(); | 599 physical_backing_size_ = view_->GetPhysicalBackingSize(); |
| 600 bool was_fullscreen = is_fullscreen_; | 600 bool was_fullscreen = is_fullscreen_; |
| 601 is_fullscreen_ = IsFullscreen(); | 601 is_fullscreen_ = IsFullscreen(); |
| 602 float old_overdraw_bottom_height = overdraw_bottom_height_; | 602 float old_overdraw_bottom_height = overdraw_bottom_height_; |
| 603 overdraw_bottom_height_ = view_->GetOverdrawBottomHeight(); | 603 overdraw_bottom_height_ = view_->GetOverdrawBottomHeight(); |
| 604 gfx::SizeF old_visible_viewport_size = visible_viewport_size_; | |
|
sky
2014/04/24 19:15:01
SizeF->Size
kevers
2014/04/24 20:09:00
Done.
| |
| 605 visible_viewport_size_ = view_->GetVisibleViewportSize(); | |
| 604 | 606 |
| 605 bool size_changed = new_size != last_requested_size_; | 607 bool size_changed = new_size != last_requested_size_; |
| 606 bool side_payload_changed = | 608 bool side_payload_changed = |
| 607 screen_info_out_of_date_ || | 609 screen_info_out_of_date_ || |
| 608 old_physical_backing_size != physical_backing_size_ || | 610 old_physical_backing_size != physical_backing_size_ || |
| 609 was_fullscreen != is_fullscreen_ || | 611 was_fullscreen != is_fullscreen_ || |
| 610 old_overdraw_bottom_height != overdraw_bottom_height_; | 612 old_overdraw_bottom_height != overdraw_bottom_height_ || |
| 613 old_visible_viewport_size != visible_viewport_size_; | |
| 611 | 614 |
| 612 if (!size_changed && !side_payload_changed) | 615 if (!size_changed && !side_payload_changed) |
| 613 return; | 616 return; |
| 614 | 617 |
| 615 if (!screen_info_) { | 618 if (!screen_info_) { |
| 616 screen_info_.reset(new blink::WebScreenInfo); | 619 screen_info_.reset(new blink::WebScreenInfo); |
| 617 GetWebScreenInfo(screen_info_.get()); | 620 GetWebScreenInfo(screen_info_.get()); |
| 618 } | 621 } |
| 619 | 622 |
| 620 // We don't expect to receive an ACK when the requested size or the physical | 623 // We don't expect to receive an ACK when the requested size or the physical |
| 621 // backing size is empty, or when the main viewport size didn't change. | 624 // backing size is empty, or when the main viewport size didn't change. |
| 622 if (!new_size.IsEmpty() && !physical_backing_size_.IsEmpty() && size_changed) | 625 if (!new_size.IsEmpty() && !physical_backing_size_.IsEmpty() && size_changed) |
| 623 resize_ack_pending_ = g_check_for_pending_resize_ack; | 626 resize_ack_pending_ = g_check_for_pending_resize_ack; |
| 624 | 627 |
| 625 ViewMsg_Resize_Params params; | 628 ViewMsg_Resize_Params params; |
| 626 params.screen_info = *screen_info_; | 629 params.screen_info = *screen_info_; |
| 627 params.new_size = new_size; | 630 params.new_size = new_size; |
| 628 params.physical_backing_size = physical_backing_size_; | 631 params.physical_backing_size = physical_backing_size_; |
| 629 params.overdraw_bottom_height = overdraw_bottom_height_; | 632 params.overdraw_bottom_height = overdraw_bottom_height_; |
| 633 params.visible_viewport_size = visible_viewport_size_; | |
| 630 params.resizer_rect = GetRootWindowResizerRect(); | 634 params.resizer_rect = GetRootWindowResizerRect(); |
| 631 params.is_fullscreen = is_fullscreen_; | 635 params.is_fullscreen = is_fullscreen_; |
| 632 if (!Send(new ViewMsg_Resize(routing_id_, params))) { | 636 if (!Send(new ViewMsg_Resize(routing_id_, params))) { |
| 633 resize_ack_pending_ = false; | 637 resize_ack_pending_ = false; |
| 634 } else { | 638 } else { |
| 635 last_requested_size_ = new_size; | 639 last_requested_size_ = new_size; |
| 636 } | 640 } |
| 637 } | 641 } |
| 638 | 642 |
| 639 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) { | 643 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) { |
| (...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2409 } | 2413 } |
| 2410 } | 2414 } |
| 2411 | 2415 |
| 2412 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2416 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2413 if (view_) | 2417 if (view_) |
| 2414 return view_->PreferredReadbackFormat(); | 2418 return view_->PreferredReadbackFormat(); |
| 2415 return SkBitmap::kARGB_8888_Config; | 2419 return SkBitmap::kARGB_8888_Config; |
| 2416 } | 2420 } |
| 2417 | 2421 |
| 2418 } // namespace content | 2422 } // namespace content |
| OLD | NEW |