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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 12328080: Plumb physical backing size from RWHV to renderer CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust for call renamed to GetViewportSizePix() Created 7 years, 10 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 85108c053db54eb8daea217da1176964d6d4d462..daba667757bc0b06966c7747ee1da73842a9dc54 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -481,26 +481,30 @@ void RenderWidgetHostImpl::WasResized() {
gfx::Rect view_bounds = view_->GetViewBounds();
gfx::Size new_size(view_bounds.size());
+ gfx::Size old_physical_backing_size = physical_backing_size_;
+ physical_backing_size_ = view_->GetPhysicalBackingSize();
bool was_fullscreen = is_fullscreen_;
is_fullscreen_ = IsFullscreen();
- bool fullscreen_changed = was_fullscreen != is_fullscreen_;
+
bool size_changed = new_size != current_size_;
+ bool side_payload_changed =
+ old_physical_backing_size != physical_backing_size_ ||
+ was_fullscreen != is_fullscreen_;
- // Avoid asking the RenderWidget to resize to its current size, since it
- // won't send us a PaintRect message in that case.
- if (!size_changed && !fullscreen_changed)
+ if (!size_changed && !side_payload_changed)
return;
if (in_flight_size_ != gfx::Size() && new_size == in_flight_size_ &&
- !fullscreen_changed)
+ !side_payload_changed)
return;
- // We don't expect to receive an ACK when the requested size is empty.
+ // We don't expect to receive an ACK when the requested size is empty or when
+ // the main viewport size didn't change.
if (!new_size.IsEmpty() && size_changed)
resize_ack_pending_ = true;
- if (!Send(new ViewMsg_Resize(routing_id_, new_size,
- GetRootWindowResizerRect(), is_fullscreen_))) {
+ if (!Send(new ViewMsg_Resize(routing_id_, new_size, physical_backing_size_,
+ GetRootWindowResizerRect(), is_fullscreen_))) {
resize_ack_pending_ = false;
} else {
in_flight_size_ = new_size;

Powered by Google App Engine
This is Rietveld 408576698