| 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 22 matching lines...) Expand all Loading... |
| 33 self = [super initWithFrame:NSZeroRect]; | 33 self = [super initWithFrame:NSZeroRect]; |
| 34 return self; | 34 return self; |
| 35 } | 35 } |
| 36 | 36 |
| 37 -(void)setCompositor:(ui::Compositor*)compositor { | 37 -(void)setCompositor:(ui::Compositor*)compositor { |
| 38 compositor_ = compositor; | 38 compositor_ = compositor; |
| 39 } | 39 } |
| 40 | 40 |
| 41 - (void)drawRect:(NSRect)rect { | 41 - (void)drawRect:(NSRect)rect { |
| 42 DCHECK(compositor_) << "Drawing with no compositor set."; | 42 DCHECK(compositor_) << "Drawing with no compositor set."; |
| 43 compositor_->ScheduleFullRedraw(); | 43 compositor_->Draw(); |
| 44 } | 44 } |
| 45 @end | 45 @end |
| 46 | 46 |
| 47 namespace ui { | 47 namespace ui { |
| 48 | 48 |
| 49 // Tests that use Objective-C memory semantics need to have a top-level | 49 // Tests that use Objective-C memory semantics need to have a top-level |
| 50 // NSAutoreleasePool set up and initialized prior to execution and drained upon | 50 // NSAutoreleasePool set up and initialized prior to execution and drained upon |
| 51 // exit. The tests will leak otherwise. | 51 // exit. The tests will leak otherwise. |
| 52 class FoundationHost { | 52 class FoundationHost { |
| 53 protected: | 53 protected: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 // static | 146 // static |
| 147 TestCompositorHost* TestCompositorHost::Create( | 147 TestCompositorHost* TestCompositorHost::Create( |
| 148 const gfx::Rect& bounds, | 148 const gfx::Rect& bounds, |
| 149 ui::ContextFactory* context_factory) { | 149 ui::ContextFactory* context_factory) { |
| 150 return new TestCompositorHostMac(bounds, context_factory); | 150 return new TestCompositorHostMac(bounds, context_factory); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace ui | 153 } // namespace ui |
| OLD | NEW |