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