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

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

Issue 7769001: Adds support for point conversions to ui::Layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/compositor/test_compositor_host.h ('k') | ui/gfx/compositor/test_suite.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/compositor/test_compositor_host.h"
6
7 #include "ui/base/win/window_impl.h"
8 #include "ui/gfx/compositor/compositor.h"
9
10 namespace ui {
11
12 class TestCompositorHostWin : public TestCompositorHost,
13 public ui::WindowImpl {
14 public:
15 explicit TestCompositorHostWin(const gfx::Rect& bounds) {
16 Init(NULL, bounds);
17 compositor_ = ui::Compositor::Create(hwnd(), GetSize());
18 }
19
20 virtual ~TestCompositorHostWin() {
21 DestroyWindow(hwnd());
22 }
23
24 // Overridden from MessageLoop::Dispatcher:
25 virtual bool Dispatch(const MSG& msg) {
26 TranslateMessage(&msg);
27 DispatchMessage(&msg);
28 return true;
29 }
30
31 // Overridden from TestCompositorHost:
32 virtual void Show() OVERRIDE {
33 ShowWindow(hwnd(), SW_SHOWNORMAL);
34 }
35 virtual ui::Compositor* GetCompositor() OVERRIDE {
36 return compositor_;
37 }
38
39 private:
40 BEGIN_MSG_MAP_EX(TestCompositorHostWin)
41 MSG_WM_PAINT(OnPaint)
42 END_MSG_MAP()
43
44 void OnPaint(HDC dc) {
45 ValidateRect(hwnd(), NULL);
46 }
47
48 gfx::Size GetSize() {
49 RECT r;
50 GetClientRect(hwnd(), &r);
51 return gfx::Rect(r).size();
52 }
53
54 scoped_refptr<ui::Compositor> compositor_;
55
56 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin);
57 };
58
59 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
60 return new TestCompositorHostWin(bounds);
61 }
62
63 } // namespace ui
64
OLDNEW
« no previous file with comments | « ui/gfx/compositor/test_compositor_host.h ('k') | ui/gfx/compositor/test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698