| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 #ifndef CHROME_GPU_GPU_VIEW_WIN_H_ | |
| 6 #define CHROME_GPU_GPU_VIEW_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <atlbase.h> | |
| 10 #include <atlapp.h> | |
| 11 #include <atlcrack.h> | |
| 12 #include <atlmisc.h> | |
| 13 | |
| 14 #include "base/basictypes.h" | |
| 15 #include "base/scoped_ptr.h" | |
| 16 #include "gfx/native_widget_types.h" | |
| 17 #include "ipc/ipc_channel.h" | |
| 18 | |
| 19 class GpuBackingStoreWin; | |
| 20 class GpuThread; | |
| 21 | |
| 22 namespace gfx { | |
| 23 class Rect; | |
| 24 class Size; | |
| 25 } | |
| 26 | |
| 27 // WS_DISABLED means that input events will be delivered to the parent, which is | |
| 28 // what we want for our overlay window. | |
| 29 typedef CWinTraits< | |
| 30 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED, 0> | |
| 31 GpuRenderWidgetHostViewWinTraits; | |
| 32 | |
| 33 class GpuViewWin | |
| 34 : public IPC::Channel::Listener, | |
| 35 public CWindowImpl<GpuViewWin, | |
| 36 CWindow, | |
| 37 GpuRenderWidgetHostViewWinTraits> { | |
| 38 public: | |
| 39 GpuViewWin(GpuThread* gpu_thread, | |
| 40 HWND parent, | |
| 41 int32 routing_id); | |
| 42 ~GpuViewWin(); | |
| 43 | |
| 44 // IPC::Channel::Listener implementation. | |
| 45 virtual void OnMessageReceived(const IPC::Message& message); | |
| 46 virtual void OnChannelConnected(int32 peer_pid); | |
| 47 virtual void OnChannelError(); | |
| 48 | |
| 49 void DidScrollBackingStoreRect(int dx, int dy, const gfx::Rect& rect); | |
| 50 | |
| 51 BEGIN_MSG_MAP(GpuViewWin) | |
| 52 MSG_WM_PAINT(OnPaint) | |
| 53 END_MSG_MAP() | |
| 54 | |
| 55 private: | |
| 56 // IPC message handlers. | |
| 57 void OnNewBackingStore(int32 routing_id, const gfx::Size& size); | |
| 58 | |
| 59 // Windows message handlers. | |
| 60 void OnPaint(HDC unused_dc); | |
| 61 | |
| 62 GpuThread* gpu_thread_; | |
| 63 int32 routing_id_; | |
| 64 | |
| 65 HWND parent_; | |
| 66 | |
| 67 scoped_ptr<GpuBackingStoreWin> backing_store_; | |
| 68 | |
| 69 DISALLOW_COPY_AND_ASSIGN(GpuViewWin); | |
| 70 }; | |
| 71 | |
| 72 #endif // CHROME_GPU_GPU_VIEW_WIN_H_ | |
| OLD | NEW |