Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: ui/views/widget/native_widget_mac_unittest.mm

Issue 2018793002: Mac: Move remote layer use to GpuOutputSurfaceMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean_up_mac
Patch Set: Review feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 namespace views { 80 namespace views {
81 namespace test { 81 namespace test {
82 82
83 // BridgedNativeWidget friend to access private members. 83 // BridgedNativeWidget friend to access private members.
84 class BridgedNativeWidgetTestApi { 84 class BridgedNativeWidgetTestApi {
85 public: 85 public:
86 explicit BridgedNativeWidgetTestApi(NSWindow* window) { 86 explicit BridgedNativeWidgetTestApi(NSWindow* window) {
87 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); 87 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window);
88 } 88 }
89 89
90 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. 90 // Simulate a frame swap from the compositor.
91 void SimulateFrameSwap(const gfx::Size& size) { 91 void SimulateFrameSwap(const gfx::Size& size) {
92 const float kScaleFactor = 1.0f; 92 const float kScaleFactor = 1.0f;
93 bridge_->compositor_widget_->GotFrame( 93 bridge_->compositor_widget_->GotIOSurfaceFrame(
94 0, false, 0, base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); 94 base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor);
95 bridge_->AcceleratedWidgetSwapCompleted(); 95 bridge_->AcceleratedWidgetSwapCompleted();
96 } 96 }
97 97
98 private: 98 private:
99 BridgedNativeWidget* bridge_; 99 BridgedNativeWidget* bridge_;
100 100
101 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); 101 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi);
102 }; 102 };
103 103
104 // Custom native_widget to create a NativeWidgetMacTestWindow. 104 // Custom native_widget to create a NativeWidgetMacTestWindow.
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 lastDirtyRect_ = dirtyRect; 1585 lastDirtyRect_ = dirtyRect;
1586 } 1586 }
1587 1587
1588 @end 1588 @end
1589 1589
1590 @implementation FocusableTestNSView 1590 @implementation FocusableTestNSView
1591 - (BOOL)acceptsFirstResponder { 1591 - (BOOL)acceptsFirstResponder {
1592 return YES; 1592 return YES;
1593 } 1593 }
1594 @end 1594 @end
OLDNEW
« no previous file with comments | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698