OLD | NEW |
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 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "ui/base/win/window_impl.h" | 8 #include "ui/base/win/window_impl.h" |
9 #include "ui/gfx/compositor/compositor.h" | 9 #include "ui/gfx/compositor/compositor.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 | 12 |
13 class TestCompositorHostWin : public TestCompositorHost, | 13 class TestCompositorHostWin : public TestCompositorHost, |
14 public WindowImpl, | 14 public WindowImpl, |
15 public CompositorDelegate { | 15 public CompositorDelegate { |
16 public: | 16 public: |
17 TestCompositorHostWin(const gfx::Rect& bounds) { | 17 TestCompositorHostWin(const gfx::Rect& bounds) { |
18 Init(NULL, bounds); | 18 Init(NULL, bounds); |
19 compositor_ = ui::Compositor::Create(this, hwnd(), GetSize()); | 19 compositor_ = new ui::Compositor(this, hwnd(), GetSize()); |
20 } | 20 } |
21 | 21 |
22 virtual ~TestCompositorHostWin() { | 22 virtual ~TestCompositorHostWin() { |
23 DestroyWindow(hwnd()); | 23 DestroyWindow(hwnd()); |
24 } | 24 } |
25 | 25 |
26 // Overridden from MessageLoop::Dispatcher: | 26 // Overridden from MessageLoop::Dispatcher: |
27 virtual bool Dispatch(const MSG& msg) { | 27 virtual bool Dispatch(const MSG& msg) { |
28 TranslateMessage(&msg); | 28 TranslateMessage(&msg); |
29 DispatchMessage(&msg); | 29 DispatchMessage(&msg); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 scoped_refptr<ui::Compositor> compositor_; | 64 scoped_refptr<ui::Compositor> compositor_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); | 66 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); |
67 }; | 67 }; |
68 | 68 |
69 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { | 69 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { |
70 return new TestCompositorHostWin(bounds); | 70 return new TestCompositorHostWin(bounds); |
71 } | 71 } |
72 | 72 |
73 } // namespace ui | 73 } // namespace ui |
OLD | NEW |