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

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

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
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/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "ui/compositor/compositor.h" 10 #include "ui/compositor/compositor.h"
11 #include "ui/gfx/win/window_impl.h" 11 #include "ui/gfx/win/window_impl.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 class TestCompositorHostWin : public TestCompositorHost, 15 class TestCompositorHostWin : public TestCompositorHost,
16 public gfx::WindowImpl { 16 public gfx::WindowImpl {
17 public: 17 public:
18 TestCompositorHostWin(const gfx::Rect& bounds, 18 TestCompositorHostWin(const gfx::Rect& bounds,
19 ui::ContextFactory* context_factory) { 19 ui::ContextFactory* context_factory) {
20 Init(NULL, bounds); 20 Init(NULL, bounds);
21 compositor_.reset(new ui::Compositor(hwnd(), 21 compositor_.reset(new ui::Compositor(context_factory,
22 context_factory,
23 base::ThreadTaskRunnerHandle::Get())); 22 base::ThreadTaskRunnerHandle::Get()));
23 compositor_->OnAcceleratedWidgetAvailable(hwnd());
24 compositor_->SetScaleAndSize(1.0f, GetSize()); 24 compositor_->SetScaleAndSize(1.0f, GetSize());
25 } 25 }
26 26
27 ~TestCompositorHostWin() override { DestroyWindow(hwnd()); } 27 ~TestCompositorHostWin() override { DestroyWindow(hwnd()); }
28 28
29 // Overridden from TestCompositorHost: 29 // Overridden from TestCompositorHost:
30 void Show() override { ShowWindow(hwnd(), SW_SHOWNORMAL); } 30 void Show() override { ShowWindow(hwnd(), SW_SHOWNORMAL); }
31 ui::Compositor* GetCompositor() override { return compositor_.get(); } 31 ui::Compositor* GetCompositor() override { return compositor_.get(); }
32 32
33 private: 33 private:
(...skipping 17 matching lines...) Expand all
51 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin); 51 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin);
52 }; 52 };
53 53
54 TestCompositorHost* TestCompositorHost::Create( 54 TestCompositorHost* TestCompositorHost::Create(
55 const gfx::Rect& bounds, 55 const gfx::Rect& bounds,
56 ui::ContextFactory* context_factory) { 56 ui::ContextFactory* context_factory) {
57 return new TestCompositorHostWin(bounds, context_factory); 57 return new TestCompositorHostWin(bounds, context_factory);
58 } 58 }
59 59
60 } // namespace ui 60 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698