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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 750173002: Move dip utils to gfx/geometry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missed android change Created 6 years 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #import "third_party/mozilla/ComplexTextInputPanel.h" 65 #import "third_party/mozilla/ComplexTextInputPanel.h"
66 #include "ui/base/cocoa/animation_utils.h" 66 #include "ui/base/cocoa/animation_utils.h"
67 #import "ui/base/cocoa/fullscreen_window_manager.h" 67 #import "ui/base/cocoa/fullscreen_window_manager.h"
68 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" 68 #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
69 #include "ui/events/keycodes/keyboard_codes.h" 69 #include "ui/events/keycodes/keyboard_codes.h"
70 #include "ui/base/layout.h" 70 #include "ui/base/layout.h"
71 #include "ui/compositor/compositor.h" 71 #include "ui/compositor/compositor.h"
72 #include "ui/compositor/layer.h" 72 #include "ui/compositor/layer.h"
73 #include "ui/gfx/display.h" 73 #include "ui/gfx/display.h"
74 #include "ui/gfx/frame_time.h" 74 #include "ui/gfx/frame_time.h"
75 #include "ui/gfx/geometry/dip_util.h"
75 #include "ui/gfx/point.h" 76 #include "ui/gfx/point.h"
76 #include "ui/gfx/rect_conversions.h" 77 #include "ui/gfx/rect_conversions.h"
77 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 78 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
78 #include "ui/gfx/screen.h" 79 #include "ui/gfx/screen.h"
79 #include "ui/gfx/size_conversions.h" 80 #include "ui/gfx/size_conversions.h"
80 #include "ui/gl/gl_switches.h" 81 #include "ui/gl/gl_switches.h"
81 82
82 using content::BrowserAccessibility; 83 using content::BrowserAccessibility;
83 using content::BrowserAccessibilityManager; 84 using content::BrowserAccessibilityManager;
84 using content::EditCommand; 85 using content::EditCommand;
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); 1428 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
1428 1429
1429 last_scroll_offset_ = frame->metadata.root_scroll_offset; 1430 last_scroll_offset_ = frame->metadata.root_scroll_offset;
1430 if (frame->delegated_frame_data) { 1431 if (frame->delegated_frame_data) {
1431 float scale_factor = frame->metadata.device_scale_factor; 1432 float scale_factor = frame->metadata.device_scale_factor;
1432 1433
1433 // Compute the frame size based on the root render pass rect size. 1434 // Compute the frame size based on the root render pass rect size.
1434 cc::RenderPass* root_pass = 1435 cc::RenderPass* root_pass =
1435 frame->delegated_frame_data->render_pass_list.back(); 1436 frame->delegated_frame_data->render_pass_list.back();
1436 gfx::Size pixel_size = root_pass->output_rect.size(); 1437 gfx::Size pixel_size = root_pass->output_rect.size();
1437 gfx::Size dip_size = 1438 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size);
1438 ConvertSizeToDIP(scale_factor, pixel_size);
1439 1439
1440 root_layer_->SetBounds(gfx::Rect(dip_size)); 1440 root_layer_->SetBounds(gfx::Rect(dip_size));
1441 if (!render_widget_host_->is_hidden()) { 1441 if (!render_widget_host_->is_hidden()) {
1442 EnsureBrowserCompositorView(); 1442 EnsureBrowserCompositorView();
1443 browser_compositor_->compositor()->SetScaleAndSize( 1443 browser_compositor_->compositor()->SetScaleAndSize(
1444 scale_factor, pixel_size); 1444 scale_factor, pixel_size);
1445 } 1445 }
1446 1446
1447 SendVSyncParametersToRenderer(); 1447 SendVSyncParametersToRenderer();
1448 1448
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
3371 3371
3372 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3372 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3373 // regions that are not draggable. (See ControlRegionView in 3373 // regions that are not draggable. (See ControlRegionView in
3374 // native_app_window_cocoa.mm). This requires the render host view to be 3374 // native_app_window_cocoa.mm). This requires the render host view to be
3375 // draggable by default. 3375 // draggable by default.
3376 - (BOOL)mouseDownCanMoveWindow { 3376 - (BOOL)mouseDownCanMoveWindow {
3377 return YES; 3377 return YES;
3378 } 3378 }
3379 3379
3380 @end 3380 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698