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_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 virtual bool IsMainThread() OVERRIDE; | 24 virtual bool IsMainThread() OVERRIDE; |
25 virtual bool IsIOThread() OVERRIDE; | 25 virtual bool IsIOThread() OVERRIDE; |
26 virtual MessageLoop* GetMainLoop() OVERRIDE; | 26 virtual MessageLoop* GetMainLoop() OVERRIDE; |
27 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; | 27 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; |
28 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; | 28 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; |
29 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( | 29 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( |
30 uint32 size) OVERRIDE; | 30 uint32 size) OVERRIDE; |
31 virtual int32 CreateViewCommandBuffer( | 31 virtual int32 CreateViewCommandBuffer( |
32 int32 surface_id, | 32 int32 surface_id, |
33 const GPUCreateCommandBufferConfig& init_params) OVERRIDE; | 33 const GPUCreateCommandBufferConfig& init_params) OVERRIDE; |
| 34 virtual void CreateImage( |
| 35 gfx::PluginWindowHandle window, |
| 36 int32 image_id, |
| 37 const CreateImageCallback& callback) OVERRIDE; |
| 38 virtual void DeleteImage(int32 image_idu, int32 sync_point) OVERRIDE; |
34 virtual GpuChannelHost* EstablishGpuChannelSync( | 39 virtual GpuChannelHost* EstablishGpuChannelSync( |
35 CauseForGpuLaunch cause_for_gpu_launch) OVERRIDE; | 40 CauseForGpuLaunch cause_for_gpu_launch) OVERRIDE; |
36 | 41 |
37 private: | 42 private: |
38 struct CreateRequest { | 43 struct CreateRequest { |
39 CreateRequest(); | 44 CreateRequest(); |
40 ~CreateRequest(); | 45 ~CreateRequest(); |
41 base::WaitableEvent event; | 46 base::WaitableEvent event; |
42 int gpu_host_id; | 47 int gpu_host_id; |
43 int32 route_id; | 48 int32 route_id; |
(...skipping 11 matching lines...) Expand all Loading... |
55 }; | 60 }; |
56 | 61 |
57 BrowserGpuChannelHostFactory(); | 62 BrowserGpuChannelHostFactory(); |
58 virtual ~BrowserGpuChannelHostFactory(); | 63 virtual ~BrowserGpuChannelHostFactory(); |
59 | 64 |
60 void CreateViewCommandBufferOnIO( | 65 void CreateViewCommandBufferOnIO( |
61 CreateRequest* request, | 66 CreateRequest* request, |
62 int32 surface_id, | 67 int32 surface_id, |
63 const GPUCreateCommandBufferConfig& init_params); | 68 const GPUCreateCommandBufferConfig& init_params); |
64 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id); | 69 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id); |
| 70 void CreateImageOnIO( |
| 71 gfx::PluginWindowHandle window, |
| 72 int32 image_id, |
| 73 const CreateImageCallback& callback); |
| 74 static void ImageCreatedOnIO( |
| 75 const CreateImageCallback& callback, const gfx::Size size); |
| 76 static void OnImageCreated( |
| 77 const CreateImageCallback& callback, const gfx::Size size); |
| 78 void DeleteImageOnIO(int32 image_id, int32 sync_point); |
65 void EstablishGpuChannelOnIO(EstablishRequest* request); | 79 void EstablishGpuChannelOnIO(EstablishRequest* request); |
66 void GpuChannelEstablishedOnIO( | 80 void GpuChannelEstablishedOnIO( |
67 EstablishRequest* request, | 81 EstablishRequest* request, |
68 const IPC::ChannelHandle& channel_handle, | 82 const IPC::ChannelHandle& channel_handle, |
69 const GPUInfo& gpu_info); | 83 const GPUInfo& gpu_info); |
70 | 84 |
71 int gpu_client_id_; | 85 int gpu_client_id_; |
72 scoped_ptr<base::WaitableEvent> shutdown_event_; | 86 scoped_ptr<base::WaitableEvent> shutdown_event_; |
73 scoped_refptr<GpuChannelHost> gpu_channel_; | 87 scoped_refptr<GpuChannelHost> gpu_channel_; |
74 int gpu_host_id_; | 88 int gpu_host_id_; |
75 | 89 |
76 static BrowserGpuChannelHostFactory* instance_; | 90 static BrowserGpuChannelHostFactory* instance_; |
77 | 91 |
78 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 92 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
79 }; | 93 }; |
80 | 94 |
81 } // namespace content | 95 } // namespace content |
82 | 96 |
83 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 97 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
OLD | NEW |