OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/compositor/test/test_compositor_host.h" | 5 #include "ui/compositor/test/test_compositor_host.h" |
6 | 6 |
7 #import <AppKit/NSApplication.h> | 7 #import <AppKit/NSApplication.h> |
8 #import <AppKit/NSOpenGL.h> | 8 #import <AppKit/NSOpenGL.h> |
9 #import <AppKit/NSView.h> | 9 #import <AppKit/NSView.h> |
10 #import <AppKit/NSWindow.h> | 10 #import <AppKit/NSWindow.h> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 window_ = [[NSWindow alloc] | 126 window_ = [[NSWindow alloc] |
127 initWithContentRect:NSMakeRect(bounds_.x(), | 127 initWithContentRect:NSMakeRect(bounds_.x(), |
128 bounds_.y(), | 128 bounds_.y(), |
129 bounds_.width(), | 129 bounds_.width(), |
130 bounds_.height()) | 130 bounds_.height()) |
131 styleMask:NSBorderlessWindowMask | 131 styleMask:NSBorderlessWindowMask |
132 backing:NSBackingStoreBuffered | 132 backing:NSBackingStoreBuffered |
133 defer:NO]; | 133 defer:NO]; |
134 base::scoped_nsobject<AcceleratedTestView> view( | 134 base::scoped_nsobject<AcceleratedTestView> view( |
135 [[AcceleratedTestView alloc] init]); | 135 [[AcceleratedTestView alloc] init]); |
136 compositor_.SetAcceleratedWidgetAndStartCompositor(view); | 136 compositor_.SetAcceleratedWidget(view); |
137 compositor_.SetScaleAndSize(1.0f, bounds_.size()); | 137 compositor_.SetScaleAndSize(1.0f, bounds_.size()); |
138 [view setCompositor:&compositor_]; | 138 [view setCompositor:&compositor_]; |
139 [window_ setContentView:view]; | 139 [window_ setContentView:view]; |
140 [window_ orderFront:nil]; | 140 [window_ orderFront:nil]; |
141 } | 141 } |
142 | 142 |
143 ui::Compositor* TestCompositorHostMac::GetCompositor() { | 143 ui::Compositor* TestCompositorHostMac::GetCompositor() { |
144 return &compositor_; | 144 return &compositor_; |
145 } | 145 } |
146 | 146 |
147 // static | 147 // static |
148 TestCompositorHost* TestCompositorHost::Create( | 148 TestCompositorHost* TestCompositorHost::Create( |
149 const gfx::Rect& bounds, | 149 const gfx::Rect& bounds, |
150 ui::ContextFactory* context_factory) { | 150 ui::ContextFactory* context_factory) { |
151 return new TestCompositorHostMac(bounds, context_factory); | 151 return new TestCompositorHostMac(bounds, context_factory); |
152 } | 152 } |
153 | 153 |
154 } // namespace ui | 154 } // namespace ui |
OLD | NEW |