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

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

Issue 1420533005: Mac: Kill lots of AcceleratedWidget code (with fire) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback 2 Created 5 years, 1 month 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/software_layer.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkBitmap bitmap; 68 bridge_->compositor_widget_->GotIOSurfaceFrame(
69 bitmap.allocN32Pixels(size.width(), size.height()); 69 base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor, false);
70 SkCanvas canvas(bitmap);
71 bridge_->compositor_widget_->GotSoftwareFrame(kScaleFactor, &canvas);
72 std::vector<ui::LatencyInfo> latency_info; 70 std::vector<ui::LatencyInfo> latency_info;
73 bridge_->AcceleratedWidgetSwapCompleted(latency_info); 71 bridge_->AcceleratedWidgetSwapCompleted(latency_info);
74 } 72 }
75 73
76 private: 74 private:
77 BridgedNativeWidget* bridge_; 75 BridgedNativeWidget* bridge_;
78 76
79 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); 77 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi);
80 }; 78 };
81 79
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 @implementation NativeWidgetMacTestWindow 1101 @implementation NativeWidgetMacTestWindow
1104 1102
1105 @synthesize invalidateShadowCount = invalidateShadowCount_; 1103 @synthesize invalidateShadowCount = invalidateShadowCount_;
1106 1104
1107 - (void)invalidateShadow { 1105 - (void)invalidateShadow {
1108 ++invalidateShadowCount_; 1106 ++invalidateShadowCount_;
1109 [super invalidateShadow]; 1107 [super invalidateShadow];
1110 } 1108 }
1111 1109
1112 @end 1110 @end
OLDNEW
« no previous file with comments | « ui/accelerated_widget_mac/software_layer.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698