OLD | NEW |
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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 struct GpuListenerInfo { | 49 struct GpuListenerInfo { |
50 GpuListenerInfo(); | 50 GpuListenerInfo(); |
51 ~GpuListenerInfo(); | 51 ~GpuListenerInfo(); |
52 | 52 |
53 base::WeakPtr<IPC::Listener> listener; | 53 base::WeakPtr<IPC::Listener> listener; |
54 scoped_refptr<base::MessageLoopProxy> loop; | 54 scoped_refptr<base::MessageLoopProxy> loop; |
55 }; | 55 }; |
56 | 56 |
57 class CONTENT_EXPORT GpuChannelHostFactory { | 57 class CONTENT_EXPORT GpuChannelHostFactory { |
58 public: | 58 public: |
| 59 typedef base::Callback<void(const gfx::Size)> CreateImageCallback; |
| 60 |
59 virtual ~GpuChannelHostFactory() {} | 61 virtual ~GpuChannelHostFactory() {} |
60 | 62 |
61 virtual bool IsMainThread() = 0; | 63 virtual bool IsMainThread() = 0; |
62 virtual bool IsIOThread() = 0; | 64 virtual bool IsIOThread() = 0; |
63 virtual MessageLoop* GetMainLoop() = 0; | 65 virtual MessageLoop* GetMainLoop() = 0; |
64 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; | 66 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; |
65 virtual base::WaitableEvent* GetShutDownEvent() = 0; | 67 virtual base::WaitableEvent* GetShutDownEvent() = 0; |
66 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0; | 68 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0; |
67 virtual int32 CreateViewCommandBuffer( | 69 virtual int32 CreateViewCommandBuffer( |
68 int32 surface_id, const GPUCreateCommandBufferConfig& init_params) = 0; | 70 int32 surface_id, const GPUCreateCommandBufferConfig& init_params) = 0; |
69 virtual GpuChannelHost* EstablishGpuChannelSync( | 71 virtual GpuChannelHost* EstablishGpuChannelSync( |
70 content::CauseForGpuLaunch) = 0; | 72 content::CauseForGpuLaunch) = 0; |
| 73 virtual void CreateImage( |
| 74 gfx::PluginWindowHandle window, |
| 75 int32 image_id, |
| 76 const CreateImageCallback& callback) = 0; |
| 77 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; |
71 }; | 78 }; |
72 | 79 |
73 // Encapsulates an IPC channel between the client and one GPU process. | 80 // Encapsulates an IPC channel between the client and one GPU process. |
74 // On the GPU process side there's a corresponding GpuChannel. | 81 // On the GPU process side there's a corresponding GpuChannel. |
75 class GpuChannelHost : public IPC::Sender, | 82 class GpuChannelHost : public IPC::Sender, |
76 public base::RefCountedThreadSafe<GpuChannelHost> { | 83 public base::RefCountedThreadSafe<GpuChannelHost> { |
77 public: | 84 public: |
78 enum State { | 85 enum State { |
79 // Not yet connected. | 86 // Not yet connected. |
80 kUnconnected, | 87 kUnconnected, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // for calls from contexts that may live on the compositor or main thread. | 202 // for calls from contexts that may live on the compositor or main thread. |
196 mutable base::Lock context_lock_; | 203 mutable base::Lock context_lock_; |
197 | 204 |
198 // A filter for sending messages from thread other than the main thread. | 205 // A filter for sending messages from thread other than the main thread. |
199 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 206 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
200 | 207 |
201 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 208 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
202 }; | 209 }; |
203 | 210 |
204 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 211 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |