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

Side by Side Diff: ui/compositor/test/test_compositor_host_x11.cc

Issue 421483003: Parameterize TaskRunner used by ui::Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_runner
Patch Set: Add missing includes Created 6 years, 4 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
« no previous file with comments | « ui/compositor/test/test_compositor_host_win.cc ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 CopyFromParent, // visual 68 CopyFromParent, // visual
69 CWEventMask | CWOverrideRedirect, &swa); 69 CWEventMask | CWOverrideRedirect, &swa);
70 XMapWindow(display, window_); 70 XMapWindow(display, window_);
71 71
72 while (1) { 72 while (1) {
73 XEvent event; 73 XEvent event;
74 XNextEvent(display, &event); 74 XNextEvent(display, &event);
75 if (event.type == MapNotify && event.xmap.window == window_) 75 if (event.type == MapNotify && event.xmap.window == window_)
76 break; 76 break;
77 } 77 }
78 compositor_.reset(new ui::Compositor(window_, context_factory_)); 78 compositor_.reset(new ui::Compositor(window_,
79 context_factory_,
80 base::MessageLoopProxy::current()));
79 compositor_->SetScaleAndSize(1.0f, bounds_.size()); 81 compositor_->SetScaleAndSize(1.0f, bounds_.size());
80 } 82 }
81 83
82 ui::Compositor* TestCompositorHostX11::GetCompositor() { 84 ui::Compositor* TestCompositorHostX11::GetCompositor() {
83 return compositor_.get(); 85 return compositor_.get();
84 } 86 }
85 87
86 void TestCompositorHostX11::Draw() { 88 void TestCompositorHostX11::Draw() {
87 if (compositor_.get()) 89 if (compositor_.get())
88 compositor_->Draw(); 90 compositor_->Draw();
89 } 91 }
90 92
91 // static 93 // static
92 TestCompositorHost* TestCompositorHost::Create( 94 TestCompositorHost* TestCompositorHost::Create(
93 const gfx::Rect& bounds, 95 const gfx::Rect& bounds,
94 ui::ContextFactory* context_factory) { 96 ui::ContextFactory* context_factory) {
95 return new TestCompositorHostX11(bounds, context_factory); 97 return new TestCompositorHostX11(bounds, context_factory);
96 } 98 }
97 99
98 } // namespace ui 100 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/test_compositor_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698