| 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 | |
| 869 void BridgedNativeWidget::AcceleratedWidgetSwapCompleted( | 865 void BridgedNativeWidget::AcceleratedWidgetSwapCompleted( |
| 870 const std::vector<ui::LatencyInfo>& latency_info) { | 866 const std::vector<ui::LatencyInfo>& latency_info) { |
| 871 // Ignore frames arriving "late" for an old size. A frame at the new size | 867 // Ignore frames arriving "late" for an old size. A frame at the new size |
| 872 // should arrive soon. | 868 // should arrive soon. |
| 873 if (!compositor_widget_->HasFrameOfSize(GetClientAreaSize())) | 869 if (!compositor_widget_->HasFrameOfSize(GetClientAreaSize())) |
| 874 return; | 870 return; |
| 875 | 871 |
| 876 if (invalidate_shadow_on_frame_swap_) { | 872 if (invalidate_shadow_on_frame_swap_) { |
| 877 invalidate_shadow_on_frame_swap_ = false; | 873 invalidate_shadow_on_frame_swap_ = false; |
| 878 [window_ invalidateShadow]; | 874 [window_ invalidateShadow]; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 [bridged_view_ setMouseDownCanMoveWindow:draggable]; | 1085 [bridged_view_ setMouseDownCanMoveWindow:draggable]; |
| 1090 // AppKit will not update its cache of mouseDownCanMoveWindow unless something | 1086 // AppKit will not update its cache of mouseDownCanMoveWindow unless something |
| 1091 // changes. Previously we tried adding an NSView and removing it, but for some | 1087 // changes. Previously we tried adding an NSView and removing it, but for some |
| 1092 // reason it required reposting the mouse-down event, and didn't always work. | 1088 // reason it required reposting the mouse-down event, and didn't always work. |
| 1093 // Calling the below seems to be an effective solution. | 1089 // Calling the below seems to be an effective solution. |
| 1094 [window_ setMovableByWindowBackground:NO]; | 1090 [window_ setMovableByWindowBackground:NO]; |
| 1095 [window_ setMovableByWindowBackground:YES]; | 1091 [window_ setMovableByWindowBackground:YES]; |
| 1096 } | 1092 } |
| 1097 | 1093 |
| 1098 } // namespace views | 1094 } // namespace views |
| OLD | NEW |