OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_native_widget.h" | 5 #import "ui/views/cocoa/bridged_native_widget.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/foundation_util.h" | 10 #import "base/mac/foundation_util.h" |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 // BridgedNativeWidget, AcceleratedWidgetMac: | 855 // BridgedNativeWidget, AcceleratedWidgetMac: |
856 | 856 |
857 NSView* BridgedNativeWidget::AcceleratedWidgetGetNSView() const { | 857 NSView* BridgedNativeWidget::AcceleratedWidgetGetNSView() const { |
858 return compositor_superview_; | 858 return compositor_superview_; |
859 } | 859 } |
860 | 860 |
861 bool BridgedNativeWidget::AcceleratedWidgetShouldIgnoreBackpressure() const { | 861 bool BridgedNativeWidget::AcceleratedWidgetShouldIgnoreBackpressure() const { |
862 return true; | 862 return true; |
863 } | 863 } |
864 | 864 |
| 865 uint32_t BridgedNativeWidget::AcceleratedWidgetGetDisplayIDForVSync() const { |
| 866 return 0; |
| 867 } |
| 868 |
865 void BridgedNativeWidget::AcceleratedWidgetSwapCompleted( | 869 void BridgedNativeWidget::AcceleratedWidgetSwapCompleted( |
866 const std::vector<ui::LatencyInfo>& latency_info) { | 870 const std::vector<ui::LatencyInfo>& latency_info) { |
867 // Ignore frames arriving "late" for an old size. A frame at the new size | 871 // Ignore frames arriving "late" for an old size. A frame at the new size |
868 // should arrive soon. | 872 // should arrive soon. |
869 if (!compositor_widget_->HasFrameOfSize(GetClientAreaSize())) | 873 if (!compositor_widget_->HasFrameOfSize(GetClientAreaSize())) |
870 return; | 874 return; |
871 | 875 |
872 if (invalidate_shadow_on_frame_swap_) { | 876 if (invalidate_shadow_on_frame_swap_) { |
873 invalidate_shadow_on_frame_swap_ = false; | 877 invalidate_shadow_on_frame_swap_ = false; |
874 [window_ invalidateShadow]; | 878 [window_ invalidateShadow]; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 [bridged_view_ setMouseDownCanMoveWindow:draggable]; | 1089 [bridged_view_ setMouseDownCanMoveWindow:draggable]; |
1086 // AppKit will not update its cache of mouseDownCanMoveWindow unless something | 1090 // AppKit will not update its cache of mouseDownCanMoveWindow unless something |
1087 // changes. Previously we tried adding an NSView and removing it, but for some | 1091 // changes. Previously we tried adding an NSView and removing it, but for some |
1088 // reason it required reposting the mouse-down event, and didn't always work. | 1092 // reason it required reposting the mouse-down event, and didn't always work. |
1089 // Calling the below seems to be an effective solution. | 1093 // Calling the below seems to be an effective solution. |
1090 [window_ setMovableByWindowBackground:NO]; | 1094 [window_ setMovableByWindowBackground:NO]; |
1091 [window_ setMovableByWindowBackground:YES]; | 1095 [window_ setMovableByWindowBackground:YES]; |
1092 } | 1096 } |
1093 | 1097 |
1094 } // namespace views | 1098 } // namespace views |
OLD | NEW |