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

Side by Side Diff: ui/gfx/compositor/test/test_compositor_host_mac.mm

Issue 9297041: Merge Compositor and CompositorCC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gfx/compositor/test/test_compositor_host.h" 5 #include "ui/gfx/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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DCHECK(!window_); 119 DCHECK(!window_);
120 window_ = [[NSWindow alloc] 120 window_ = [[NSWindow alloc]
121 initWithContentRect:NSMakeRect(bounds_.x(), 121 initWithContentRect:NSMakeRect(bounds_.x(),
122 bounds_.y(), 122 bounds_.y(),
123 bounds_.width(), 123 bounds_.width(),
124 bounds_.height()) 124 bounds_.height())
125 styleMask:NSBorderlessWindowMask 125 styleMask:NSBorderlessWindowMask
126 backing:NSBackingStoreBuffered 126 backing:NSBackingStoreBuffered
127 defer:NO]; 127 defer:NO];
128 scoped_nsobject<AcceleratedTestView> view([[AcceleratedTestView alloc] init]); 128 scoped_nsobject<AcceleratedTestView> view([[AcceleratedTestView alloc] init]);
129 compositor_ = ui::Compositor::Create(this, view, bounds_.size()); 129 compositor_ = new ui::Compositor(this, view, bounds_.size());
130 [view setCompositor:compositor_]; 130 [view setCompositor:compositor_];
131 [window_ setContentView:view]; 131 [window_ setContentView:view];
132 [window_ orderFront:nil]; 132 [window_ orderFront:nil];
133 } 133 }
134 134
135 ui::Compositor* TestCompositorHostMac::GetCompositor() { 135 ui::Compositor* TestCompositorHostMac::GetCompositor() {
136 return compositor_; 136 return compositor_;
137 } 137 }
138 138
139 void TestCompositorHostMac::ScheduleDraw() { 139 void TestCompositorHostMac::ScheduleDraw() {
140 if (!compositor_) 140 if (!compositor_)
141 return; 141 return;
142 142
143 // Force display now. 143 // Force display now.
144 [window_ display]; 144 [window_ display];
145 } 145 }
146 146
147 // static 147 // static
148 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { 148 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
149 return new TestCompositorHostMac(bounds); 149 return new TestCompositorHostMac(bounds);
150 } 150 }
151 151
152 } // namespace ui 152 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/compositor/test/test_compositor_host_linux.cc ('k') | ui/gfx/compositor/test/test_compositor_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698