| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 TestCompositorHostMac::TestCompositorHostMac( | 106 TestCompositorHostMac::TestCompositorHostMac( |
| 107 const gfx::Rect& bounds, | 107 const gfx::Rect& bounds, |
| 108 ui::ContextFactory* context_factory, | 108 ui::ContextFactory* context_factory, |
| 109 ui::ContextFactoryPrivate* context_factory_private) | 109 ui::ContextFactoryPrivate* context_factory_private) |
| 110 : bounds_(bounds), | 110 : bounds_(bounds), |
| 111 compositor_(context_factory_private->AllocateFrameSinkId(), | 111 compositor_(context_factory_private->AllocateFrameSinkId(), |
| 112 context_factory, | 112 context_factory, |
| 113 context_factory_private, | 113 context_factory_private, |
| 114 base::ThreadTaskRunnerHandle::Get(), | 114 base::ThreadTaskRunnerHandle::Get(), |
| 115 false /* enable_surface_synchronization */), | 115 false /* enable_surface_synchronization */, |
| 116 false /* enable_pixel_canvas */), |
| 116 window_(nil) {} | 117 window_(nil) {} |
| 117 | 118 |
| 118 TestCompositorHostMac::~TestCompositorHostMac() { | 119 TestCompositorHostMac::~TestCompositorHostMac() { |
| 119 // Release reference to |compositor_|. Important because the |compositor_| | 120 // Release reference to |compositor_|. Important because the |compositor_| |
| 120 // holds |this| as its delegate, so that reference must be removed here. | 121 // holds |this| as its delegate, so that reference must be removed here. |
| 121 [[window_ contentView] setCompositor:NULL]; | 122 [[window_ contentView] setCompositor:NULL]; |
| 122 { | 123 { |
| 123 base::scoped_nsobject<NSView> new_view( | 124 base::scoped_nsobject<NSView> new_view( |
| 124 [[NSView alloc] initWithFrame:NSZeroRect]); | 125 [[NSView alloc] initWithFrame:NSZeroRect]); |
| 125 [window_ setContentView:new_view.get()]; | 126 [window_ setContentView:new_view.get()]; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 155 // static | 156 // static |
| 156 TestCompositorHost* TestCompositorHost::Create( | 157 TestCompositorHost* TestCompositorHost::Create( |
| 157 const gfx::Rect& bounds, | 158 const gfx::Rect& bounds, |
| 158 ui::ContextFactory* context_factory, | 159 ui::ContextFactory* context_factory, |
| 159 ui::ContextFactoryPrivate* context_factory_private) { | 160 ui::ContextFactoryPrivate* context_factory_private) { |
| 160 return new TestCompositorHostMac(bounds, context_factory, | 161 return new TestCompositorHostMac(bounds, context_factory, |
| 161 context_factory_private); | 162 context_factory_private); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace ui | 165 } // namespace ui |
| OLD | NEW |