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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 375793002: Fix viewport computation in Mac UC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scrollbar
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 5fd0b1b2e23be0b57cb740280dfa3cab11645c7b..56da88211eccfa88bb256168282593ab5b7b8268 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1813,11 +1813,15 @@ void RenderWidgetHostViewMac::OnSwapCompositorFrame(
if (frame->delegated_frame_data) {
float scale_factor = frame->metadata.device_scale_factor;
- gfx::Size dip_size = ToCeiledSize(frame->metadata.viewport_size);
- gfx::Size pixel_size = ConvertSizeToPixel(
- scale_factor, dip_size);
- root_layer_->SetBounds(gfx::Rect(dip_size));
+ // Compute the frame size based on the root render pass rect size.
+ cc::RenderPass* root_pass =
+ frame->delegated_frame_data->render_pass_list.back();
+ gfx::Size pixel_size = root_pass->output_rect.size();
+ gfx::Size dip_size =
+ ConvertSizeToDIP(scale_factor, pixel_size);
+
+ root_layer_->SetBounds(gfx::Rect(dip_size));
if (!render_widget_host_->is_hidden()) {
EnsureBrowserCompositorView();
browser_compositor_view_->GetCompositor()->SetScaleAndSize(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698