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/widget/native_widget_mac.h" | 5 #import "ui/views/widget/native_widget_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // BridgedNativeWidget friend to access private members. | 58 // BridgedNativeWidget friend to access private members. |
59 class BridgedNativeWidgetTestApi { | 59 class BridgedNativeWidgetTestApi { |
60 public: | 60 public: |
61 explicit BridgedNativeWidgetTestApi(NSWindow* window) { | 61 explicit BridgedNativeWidgetTestApi(NSWindow* window) { |
62 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); | 62 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); |
63 } | 63 } |
64 | 64 |
65 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. | 65 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. |
66 void SimulateFrameSwap(const gfx::Size& size) { | 66 void SimulateFrameSwap(const gfx::Size& size) { |
67 const float kScaleFactor = 1.0f; | 67 const float kScaleFactor = 1.0f; |
68 bridge_->compositor_widget_->GotIOSurfaceFrame( | 68 bridge_->compositor_widget_->GotFrame( |
69 base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor, false); | 69 0, base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); |
70 std::vector<ui::LatencyInfo> latency_info; | 70 bridge_->AcceleratedWidgetSwapCompleted(); |
71 bridge_->AcceleratedWidgetSwapCompleted(latency_info); | |
72 } | 71 } |
73 | 72 |
74 private: | 73 private: |
75 BridgedNativeWidget* bridge_; | 74 BridgedNativeWidget* bridge_; |
76 | 75 |
77 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); | 76 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); |
78 }; | 77 }; |
79 | 78 |
80 // Custom native_widget to create a NativeWidgetMacTestWindow. | 79 // Custom native_widget to create a NativeWidgetMacTestWindow. |
81 class TestWindowNativeWidgetMac : public NativeWidgetMac { | 80 class TestWindowNativeWidgetMac : public NativeWidgetMac { |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 @implementation NativeWidgetMacTestWindow | 1100 @implementation NativeWidgetMacTestWindow |
1102 | 1101 |
1103 @synthesize invalidateShadowCount = invalidateShadowCount_; | 1102 @synthesize invalidateShadowCount = invalidateShadowCount_; |
1104 | 1103 |
1105 - (void)invalidateShadow { | 1104 - (void)invalidateShadow { |
1106 ++invalidateShadowCount_; | 1105 ++invalidateShadowCount_; |
1107 [super invalidateShadow]; | 1106 [super invalidateShadow]; |
1108 } | 1107 } |
1109 | 1108 |
1110 @end | 1109 @end |
OLD | NEW |