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_X_H_ | |
6 #define CHROME_GPU_GPU_VIEW_X_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/scoped_ptr.h" | |
11 #include "chrome/gpu/x_util.h" | |
12 #include "gfx/native_widget_types.h" | |
13 #include "ipc/ipc_channel.h" | |
14 | |
15 class GpuBackingStoreGLX; | |
16 class GpuThread; | |
17 class GpuVideoLayerGLX; | |
18 | |
19 namespace gfx { | |
20 class Rect; | |
21 class Size; | |
22 } | |
23 | |
24 class GpuViewX | |
25 : public IPC::Channel::Listener { | |
26 public: | |
27 GpuViewX(GpuThread* gpu_thread, | |
28 XID parent, | |
29 int32 routing_id); | |
30 ~GpuViewX(); | |
31 | |
32 GpuThread* gpu_thread() const { return gpu_thread_; } | |
33 XID window() const { return window_; } | |
34 | |
35 // Wrapper around GPUBackingStoreGLXContext using our current window. | |
36 GLXContext BindContext(); | |
37 | |
38 // IPC::Channel::Listener implementation. | |
39 virtual void OnMessageReceived(const IPC::Message& message); | |
40 virtual void OnChannelConnected(int32 peer_pid); | |
41 virtual void OnChannelError(); | |
42 | |
43 void DidScrollBackingStoreRect(int dx, int dy, const gfx::Rect& rect); | |
44 | |
45 void Repaint(); | |
46 | |
47 private: | |
48 // IPC message handlers. | |
49 void OnNewBackingStore(int32 routing_id, const gfx::Size& size); | |
50 void OnNewVideoLayer(int32 routing_id, const gfx::Size& size); | |
51 void OnWindowPainted(); | |
52 | |
53 GpuThread* gpu_thread_; | |
54 int32 routing_id_; | |
55 | |
56 XID window_; | |
57 | |
58 scoped_ptr<GpuBackingStoreGLX> backing_store_; | |
59 | |
60 scoped_ptr<GpuVideoLayerGLX> video_layer_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(GpuViewX); | |
63 }; | |
64 | |
65 #endif // CHROME_GPU_GPU_VIEW_X_H_ | |
OLD | NEW |