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 <memory> |
| 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
11 #include "ui/compositor/compositor.h" | 12 #include "ui/compositor/compositor.h" |
12 #include "ui/gfx/win/window_impl.h" | 13 #include "ui/gfx/win/window_impl.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 | 16 |
16 class TestCompositorHostWin : public TestCompositorHost, | 17 class TestCompositorHostWin : public TestCompositorHost, |
17 public gfx::WindowImpl { | 18 public gfx::WindowImpl { |
18 public: | 19 public: |
19 TestCompositorHostWin(const gfx::Rect& bounds, | 20 TestCompositorHostWin(const gfx::Rect& bounds, |
(...skipping 20 matching lines...) Expand all Loading... |
40 compositor_->ScheduleFullRedraw(); | 41 compositor_->ScheduleFullRedraw(); |
41 ValidateRect(hwnd(), NULL); | 42 ValidateRect(hwnd(), NULL); |
42 } | 43 } |
43 | 44 |
44 gfx::Size GetSize() { | 45 gfx::Size GetSize() { |
45 RECT r; | 46 RECT r; |
46 GetClientRect(hwnd(), &r); | 47 GetClientRect(hwnd(), &r); |
47 return gfx::Rect(r).size(); | 48 return gfx::Rect(r).size(); |
48 } | 49 } |
49 | 50 |
50 scoped_ptr<ui::Compositor> compositor_; | 51 std::unique_ptr<ui::Compositor> compositor_; |
51 | 52 |
52 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); | 53 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); |
53 }; | 54 }; |
54 | 55 |
55 TestCompositorHost* TestCompositorHost::Create( | 56 TestCompositorHost* TestCompositorHost::Create( |
56 const gfx::Rect& bounds, | 57 const gfx::Rect& bounds, |
57 ui::ContextFactory* context_factory) { | 58 ui::ContextFactory* context_factory) { |
58 return new TestCompositorHostWin(bounds, context_factory); | 59 return new TestCompositorHostWin(bounds, context_factory); |
59 } | 60 } |
60 | 61 |
61 } // namespace ui | 62 } // namespace ui |
OLD | NEW |