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_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 12 matching lines...) Expand all Loading... |
23 #include "base/metrics/histogram.h" | 23 #include "base/metrics/histogram.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
26 #include "base/strings/sys_string_conversions.h" | 26 #include "base/strings/sys_string_conversions.h" |
27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
28 #include "base/sys_info.h" | 28 #include "base/sys_info.h" |
29 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 29 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
30 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" | 30 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" |
31 #import "content/browser/cocoa/system_hotkey_helper_mac.h" | 31 #import "content/browser/cocoa/system_hotkey_helper_mac.h" |
32 #import "content/browser/cocoa/system_hotkey_map.h" | 32 #import "content/browser/cocoa/system_hotkey_map.h" |
33 #include "content/browser/compositor/io_surface_layer_mac.h" | |
34 #include "content/browser/compositor/resize_lock.h" | 33 #include "content/browser/compositor/resize_lock.h" |
35 #include "content/browser/frame_host/frame_tree.h" | 34 #include "content/browser/frame_host/frame_tree.h" |
36 #include "content/browser/frame_host/frame_tree_node.h" | 35 #include "content/browser/frame_host/frame_tree_node.h" |
37 #include "content/browser/frame_host/render_frame_host_impl.h" | 36 #include "content/browser/frame_host/render_frame_host_impl.h" |
38 #include "content/browser/gpu/compositor_util.h" | 37 #include "content/browser/gpu/compositor_util.h" |
| 38 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 39 #include "content/browser/renderer_host/render_view_host_impl.h" |
39 #include "content/browser/renderer_host/render_widget_helper.h" | 40 #include "content/browser/renderer_host/render_widget_helper.h" |
40 #include "content/browser/renderer_host/render_view_host_impl.h" | |
41 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" | 41 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" |
42 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" | 42 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" |
43 #import "content/browser/renderer_host/text_input_client_mac.h" | 43 #import "content/browser/renderer_host/text_input_client_mac.h" |
44 #include "content/common/accessibility_messages.h" | 44 #include "content/common/accessibility_messages.h" |
45 #include "content/common/edit_command.h" | 45 #include "content/common/edit_command.h" |
46 #include "content/common/gpu/gpu_messages.h" | 46 #include "content/common/gpu/gpu_messages.h" |
47 #include "content/common/gpu/surface_handle_types_mac.h" | |
48 #include "content/common/input_messages.h" | 47 #include "content/common/input_messages.h" |
49 #include "content/common/view_messages.h" | 48 #include "content/common/view_messages.h" |
50 #include "content/common/webplugin_geometry.h" | 49 #include "content/common/webplugin_geometry.h" |
51 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
52 #include "content/public/browser/native_web_keyboard_event.h" | 51 #include "content/public/browser/native_web_keyboard_event.h" |
53 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
54 #include "content/public/browser/notification_types.h" | 53 #include "content/public/browser/notification_types.h" |
55 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 54 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
56 #import "content/public/browser/render_widget_host_view_mac_delegate.h" | 55 #import "content/public/browser/render_widget_host_view_mac_delegate.h" |
57 #include "content/public/browser/user_metrics.h" | 56 #include "content/public/browser/user_metrics.h" |
58 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
| 58 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
59 #include "skia/ext/platform_canvas.h" | 59 #include "skia/ext/platform_canvas.h" |
60 #include "skia/ext/skia_utils_mac.h" | 60 #include "skia/ext/skia_utils_mac.h" |
61 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 61 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
62 #include "third_party/WebKit/public/web/WebInputEvent.h" | 62 #include "third_party/WebKit/public/web/WebInputEvent.h" |
63 #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h" | 63 #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h" |
64 #import "third_party/mozilla/ComplexTextInputPanel.h" | 64 #import "third_party/mozilla/ComplexTextInputPanel.h" |
65 #include "ui/base/cocoa/animation_utils.h" | 65 #include "ui/base/cocoa/animation_utils.h" |
66 #import "ui/base/cocoa/fullscreen_window_manager.h" | 66 #import "ui/base/cocoa/fullscreen_window_manager.h" |
67 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" | 67 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" |
68 #include "ui/events/keycodes/keyboard_codes.h" | |
69 #include "ui/base/layout.h" | 68 #include "ui/base/layout.h" |
70 #include "ui/compositor/compositor.h" | 69 #include "ui/compositor/compositor.h" |
71 #include "ui/compositor/layer.h" | 70 #include "ui/compositor/layer.h" |
| 71 #include "ui/compositor/mac/io_surface_layer_mac.h" |
| 72 #include "ui/compositor/mac/surface_handle_types_mac.h" |
| 73 #include "ui/events/keycodes/keyboard_codes.h" |
72 #include "ui/gfx/display.h" | 74 #include "ui/gfx/display.h" |
73 #include "ui/gfx/frame_time.h" | 75 #include "ui/gfx/frame_time.h" |
74 #include "ui/gfx/point.h" | 76 #include "ui/gfx/point.h" |
75 #include "ui/gfx/rect_conversions.h" | 77 #include "ui/gfx/rect_conversions.h" |
76 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 78 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
77 #include "ui/gfx/screen.h" | 79 #include "ui/gfx/screen.h" |
78 #include "ui/gfx/size_conversions.h" | 80 #include "ui/gfx/size_conversions.h" |
79 #include "ui/gl/gl_switches.h" | 81 #include "ui/gl/gl_switches.h" |
80 | 82 |
81 using content::BrowserAccessibility; | 83 using content::BrowserAccessibility; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // immediately. | 482 // immediately. |
481 return true; | 483 return true; |
482 } | 484 } |
483 } | 485 } |
484 | 486 |
485 // If the window occlusion API is not present then ack frames when we draw | 487 // If the window occlusion API is not present then ack frames when we draw |
486 // them. | 488 // them. |
487 return false; | 489 return false; |
488 } | 490 } |
489 | 491 |
| 492 bool RenderWidgetHostViewMac::AcceleratedWidgetNeedsGLFinishWorkaround() const { |
| 493 return GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( |
| 494 gpu::FORCE_GL_FINISH_AFTER_COMPOSITING); |
| 495 } |
| 496 |
490 void RenderWidgetHostViewMac::AcceleratedWidgetSwapCompleted( | 497 void RenderWidgetHostViewMac::AcceleratedWidgetSwapCompleted( |
491 const std::vector<ui::LatencyInfo>& all_latency_info) { | 498 const std::vector<ui::LatencyInfo>& all_latency_info) { |
492 if (!render_widget_host_) | 499 if (!render_widget_host_) |
493 return; | 500 return; |
494 for (auto latency_info : all_latency_info) { | 501 for (auto latency_info : all_latency_info) { |
495 latency_info.AddLatencyNumber( | 502 latency_info.AddLatencyNumber( |
496 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); | 503 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
497 render_widget_host_->FrameSwapped(latency_info); | 504 render_widget_host_->FrameSwapped(latency_info); |
498 } | 505 } |
499 } | 506 } |
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3370 | 3377 |
3371 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3378 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3372 // regions that are not draggable. (See ControlRegionView in | 3379 // regions that are not draggable. (See ControlRegionView in |
3373 // native_app_window_cocoa.mm). This requires the render host view to be | 3380 // native_app_window_cocoa.mm). This requires the render host view to be |
3374 // draggable by default. | 3381 // draggable by default. |
3375 - (BOOL)mouseDownCanMoveWindow { | 3382 - (BOOL)mouseDownCanMoveWindow { |
3376 return YES; | 3383 return YES; |
3377 } | 3384 } |
3378 | 3385 |
3379 @end | 3386 @end |
OLD | NEW |