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 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" |
9 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
10 #include "ui/gfx/win/window_impl.h" | 11 #include "ui/gfx/win/window_impl.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 | 14 |
14 class TestCompositorHostWin : public TestCompositorHost, | 15 class TestCompositorHostWin : public TestCompositorHost, |
15 public gfx::WindowImpl { | 16 public gfx::WindowImpl { |
16 public: | 17 public: |
17 TestCompositorHostWin(const gfx::Rect& bounds, | 18 TestCompositorHostWin(const gfx::Rect& bounds, |
18 ui::ContextFactory* context_factory) { | 19 ui::ContextFactory* context_factory) { |
19 Init(NULL, bounds); | 20 Init(NULL, bounds); |
20 compositor_.reset(new ui::Compositor(hwnd(), context_factory)); | 21 compositor_.reset(new ui::Compositor(hwnd(), |
| 22 context_factory, |
| 23 base::MessageLoopProxy::current())); |
21 compositor_->SetScaleAndSize(1.0f, GetSize()); | 24 compositor_->SetScaleAndSize(1.0f, GetSize()); |
22 } | 25 } |
23 | 26 |
24 virtual ~TestCompositorHostWin() { | 27 virtual ~TestCompositorHostWin() { |
25 DestroyWindow(hwnd()); | 28 DestroyWindow(hwnd()); |
26 } | 29 } |
27 | 30 |
28 // Overridden from TestCompositorHost: | 31 // Overridden from TestCompositorHost: |
29 virtual void Show() OVERRIDE { | 32 virtual void Show() OVERRIDE { |
30 ShowWindow(hwnd(), SW_SHOWNORMAL); | 33 ShowWindow(hwnd(), SW_SHOWNORMAL); |
(...skipping 23 matching lines...) Expand all Loading... |
54 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); | 57 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); |
55 }; | 58 }; |
56 | 59 |
57 TestCompositorHost* TestCompositorHost::Create( | 60 TestCompositorHost* TestCompositorHost::Create( |
58 const gfx::Rect& bounds, | 61 const gfx::Rect& bounds, |
59 ui::ContextFactory* context_factory) { | 62 ui::ContextFactory* context_factory) { |
60 return new TestCompositorHostWin(bounds, context_factory); | 63 return new TestCompositorHostWin(bounds, context_factory); |
61 } | 64 } |
62 | 65 |
63 } // namespace ui | 66 } // namespace ui |
OLD | NEW |