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 <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
10 #include <QuartzCore/QuartzCore.h> | 10 #include <QuartzCore/QuartzCore.h> |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1421 // Don't do anything if it's an editable node, as this will be handled by | 1421 // Don't do anything if it's an editable node, as this will be handled by |
1422 // OnSelectionBoundsChanged instead. | 1422 // OnSelectionBoundsChanged instead. |
1423 if (UAZoomEnabled() && !is_editable_node) { | 1423 if (UAZoomEnabled() && !is_editable_node) { |
1424 NSRect bounds = NSRectFromCGRect(node_bounds_in_screen.ToCGRect()); | 1424 NSRect bounds = NSRectFromCGRect(node_bounds_in_screen.ToCGRect()); |
1425 UAZoomChangeFocus(&bounds, NULL, kUAZoomFocusTypeOther); | 1425 UAZoomChangeFocus(&bounds, NULL, kUAZoomFocusTypeOther); |
1426 } | 1426 } |
1427 } | 1427 } |
1428 | 1428 |
1429 void RenderWidgetHostViewMac::OnSwapCompositorFrame( | 1429 void RenderWidgetHostViewMac::OnSwapCompositorFrame( |
1430 uint32_t compositor_frame_sink_id, | 1430 uint32_t compositor_frame_sink_id, |
1431 cc::LocalSurfaceId local_surface_id, | |
Fady Samuel
2017/03/15 12:05:48
const cc::LocalSurfaceId&
Saman Sami
2017/03/16 18:33:07
Done.
| |
1431 cc::CompositorFrame frame) { | 1432 cc::CompositorFrame frame) { |
1432 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); | 1433 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); |
1433 | 1434 |
1434 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 1435 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
1435 | 1436 |
1436 page_at_minimum_scale_ = | 1437 page_at_minimum_scale_ = |
1437 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor; | 1438 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor; |
1438 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id, | 1439 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id, |
1439 std::move(frame)); | 1440 local_surface_id, std::move(frame)); |
1440 UpdateDisplayVSyncParameters(); | 1441 UpdateDisplayVSyncParameters(); |
1441 } | 1442 } |
1442 | 1443 |
1443 void RenderWidgetHostViewMac::ClearCompositorFrame() { | 1444 void RenderWidgetHostViewMac::ClearCompositorFrame() { |
1444 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame(); | 1445 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame(); |
1445 } | 1446 } |
1446 | 1447 |
1447 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() { | 1448 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() { |
1448 // TODO(shess): In case of !window, the view has been removed from | 1449 // TODO(shess): In case of !window, the view has been removed from |
1449 // the view hierarchy because the tab isn't main. Could retrieve | 1450 // the view hierarchy because the tab isn't main. Could retrieve |
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3481 | 3482 |
3482 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3483 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3483 // regions that are not draggable. (See ControlRegionView in | 3484 // regions that are not draggable. (See ControlRegionView in |
3484 // native_app_window_cocoa.mm). This requires the render host view to be | 3485 // native_app_window_cocoa.mm). This requires the render host view to be |
3485 // draggable by default. | 3486 // draggable by default. |
3486 - (BOOL)mouseDownCanMoveWindow { | 3487 - (BOOL)mouseDownCanMoveWindow { |
3487 return YES; | 3488 return YES; |
3488 } | 3489 } |
3489 | 3490 |
3490 @end | 3491 @end |
OLD | NEW |