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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/test_compositor_host_win.cc
===================================================================
--- ui/gfx/compositor/test_compositor_host_win.cc (revision 0)
+++ ui/gfx/compositor/test_compositor_host_win.cc (revision 0)
@@ -0,0 +1,64 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/compositor/test_compositor_host.h"
+
+#include "ui/base/win/window_impl.h"
+#include "ui/gfx/compositor/compositor.h"
+
+namespace ui {
+
+class TestCompositorHostWin : public TestCompositorHost,
+ public ui::WindowImpl {
+ public:
+ explicit TestCompositorHostWin(const gfx::Rect& bounds) {
+ Init(NULL, bounds);
+ compositor_ = ui::Compositor::Create(hwnd(), GetSize());
+ }
+
+ virtual ~TestCompositorHostWin() {
+ DestroyWindow(hwnd());
+ }
+
+ // Overridden from MessageLoop::Dispatcher:
+ virtual bool Dispatch(const MSG& msg) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ return true;
+ }
+
+ // Overridden from TestCompositorHost:
+ virtual void Show() OVERRIDE {
+ ShowWindow(hwnd(), SW_SHOWNORMAL);
+ }
+ virtual ui::Compositor* GetCompositor() OVERRIDE {
+ return compositor_;
+ }
+
+ private:
+ BEGIN_MSG_MAP_EX(TestCompositorHostWin)
+ MSG_WM_PAINT(OnPaint)
+ END_MSG_MAP()
+
+ void OnPaint(HDC dc) {
+ ValidateRect(hwnd(), NULL);
+ }
+
+ gfx::Size GetSize() {
+ RECT r;
+ GetClientRect(hwnd(), &r);
+ return gfx::Rect(r).size();
+ }
+
+ scoped_refptr<ui::Compositor> compositor_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestCompositorHostWin);
+};
+
+TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
+ return new TestCompositorHostWin(bounds);
+}
+
+} // namespace ui
+
Property changes on: ui\gfx\compositor\test_compositor_host_win.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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