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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 10
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 } 1806 }
1807 return false; 1807 return false;
1808 } 1808 }
1809 1809
1810 void RenderWidgetHostViewMac::OnSwapCompositorFrame( 1810 void RenderWidgetHostViewMac::OnSwapCompositorFrame(
1811 uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { 1811 uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) {
1812 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); 1812 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
1813 1813
1814 if (frame->delegated_frame_data) { 1814 if (frame->delegated_frame_data) {
1815 float scale_factor = frame->metadata.device_scale_factor; 1815 float scale_factor = frame->metadata.device_scale_factor;
1816 gfx::Size dip_size = ToCeiledSize(frame->metadata.viewport_size); 1816
1817 gfx::Size pixel_size = ConvertSizeToPixel( 1817 // Compute the frame size based on the root render pass rect size.
1818 scale_factor, dip_size); 1818 cc::RenderPass* root_pass =
1819 frame->delegated_frame_data->render_pass_list.back();
1820 gfx::Size pixel_size = root_pass->output_rect.size();
1821 gfx::Size dip_size =
1822 ConvertSizeToDIP(scale_factor, pixel_size);
1823
1819 root_layer_->SetBounds(gfx::Rect(dip_size)); 1824 root_layer_->SetBounds(gfx::Rect(dip_size));
1820
1821 if (!render_widget_host_->is_hidden()) { 1825 if (!render_widget_host_->is_hidden()) {
1822 EnsureBrowserCompositorView(); 1826 EnsureBrowserCompositorView();
1823 browser_compositor_view_->GetCompositor()->SetScaleAndSize( 1827 browser_compositor_view_->GetCompositor()->SetScaleAndSize(
1824 scale_factor, pixel_size); 1828 scale_factor, pixel_size);
1825 } 1829 }
1826 1830
1827 SendVSyncParametersToRenderer(); 1831 SendVSyncParametersToRenderer();
1828 1832
1829 delegated_frame_host_->SwapDelegatedFrame( 1833 delegated_frame_host_->SwapDelegatedFrame(
1830 output_surface_id, 1834 output_surface_id,
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3950 3954
3951 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3955 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3952 // regions that are not draggable. (See ControlRegionView in 3956 // regions that are not draggable. (See ControlRegionView in
3953 // native_app_window_cocoa.mm). This requires the render host view to be 3957 // native_app_window_cocoa.mm). This requires the render host view to be
3954 // draggable by default. 3958 // draggable by default.
3955 - (BOOL)mouseDownCanMoveWindow { 3959 - (BOOL)mouseDownCanMoveWindow {
3956 return YES; 3960 return YES;
3957 } 3961 }
3958 3962
3959 @end 3963 @end
OLDNEW
« 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