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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 virtual void CreateImage( | 34 virtual void CreateImage( |
35 gfx::PluginWindowHandle window, | 35 gfx::PluginWindowHandle window, |
36 int32 image_id, | 36 int32 image_id, |
37 const CreateImageCallback& callback) OVERRIDE; | 37 const CreateImageCallback& callback) OVERRIDE; |
38 virtual void DeleteImage(int32 image_idu, int32 sync_point) OVERRIDE; | 38 virtual void DeleteImage(int32 image_idu, int32 sync_point) OVERRIDE; |
39 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 39 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
40 size_t width, | 40 size_t width, |
41 size_t height, | 41 size_t height, |
42 unsigned internalformat, | 42 unsigned internalformat, |
43 unsigned usage) OVERRIDE; | 43 unsigned usage) OVERRIDE; |
44 virtual void AllocateGpuMemoryBufferAsync( | |
reveman
2014/05/27 22:46:01
I'd like to have this replace Create/DeleteImage.
alexst (slow to review)
2014/05/28 14:18:57
I was planning to add the new way first and then r
reveman
2014/05/28 16:42:26
Removing Create/DeleteImage in follow up patches i
| |
45 const gfx::GpuMemoryBufferParams& params, | |
reveman
2014/05/27 22:46:01
The idea I had for this IPC was that it would take
alexst (slow to review)
2014/05/28 14:18:57
Got it.
| |
46 const AllocateGpuMemoryBufferCallback& callback) OVERRIDE; | |
44 | 47 |
45 // Specify a task runner and callback to be used for a set of messages. The | 48 // Specify a task runner and callback to be used for a set of messages. The |
46 // callback will be set up on the current GpuProcessHost, identified by | 49 // callback will be set up on the current GpuProcessHost, identified by |
47 // GpuProcessHostId(). | 50 // GpuProcessHostId(). |
48 virtual void SetHandlerForControlMessages( | 51 virtual void SetHandlerForControlMessages( |
49 const uint32* message_ids, | 52 const uint32* message_ids, |
50 size_t num_messages, | 53 size_t num_messages, |
51 const base::Callback<void(const IPC::Message&)>& handler, | 54 const base::Callback<void(const IPC::Message&)>& handler, |
52 base::TaskRunner* target_task_runner); | 55 base::TaskRunner* target_task_runner); |
53 int GpuProcessHostId() { return gpu_host_id_; } | 56 int GpuProcessHostId() { return gpu_host_id_; } |
(...skipping 25 matching lines...) Expand all Loading... | |
79 int32 image_id, | 82 int32 image_id, |
80 const CreateImageCallback& callback); | 83 const CreateImageCallback& callback); |
81 static void ImageCreatedOnIO( | 84 static void ImageCreatedOnIO( |
82 const CreateImageCallback& callback, const gfx::Size size); | 85 const CreateImageCallback& callback, const gfx::Size size); |
83 static void OnImageCreated( | 86 static void OnImageCreated( |
84 const CreateImageCallback& callback, const gfx::Size size); | 87 const CreateImageCallback& callback, const gfx::Size size); |
85 void DeleteImageOnIO(int32 image_id, int32 sync_point); | 88 void DeleteImageOnIO(int32 image_id, int32 sync_point); |
86 static void AddFilterOnIO(int gpu_host_id, | 89 static void AddFilterOnIO(int gpu_host_id, |
87 scoped_refptr<IPC::MessageFilter> filter); | 90 scoped_refptr<IPC::MessageFilter> filter); |
88 | 91 |
92 void AllocateGpuMemoryBufferAsyncOnIO( | |
93 const gfx::GpuMemoryBufferParams& params, | |
94 const AllocateGpuMemoryBufferCallback& callback); | |
95 static void GpuMemoryBufferAllocatedAsyncOnIO( | |
96 const AllocateGpuMemoryBufferCallback&, | |
97 const gfx::GpuMemoryBufferHandle& handle); | |
98 static void GpuMemoryBufferAllocatedAsync( | |
99 const AllocateGpuMemoryBufferCallback&, | |
100 const gfx::GpuMemoryBufferHandle& handle); | |
101 | |
89 const int gpu_client_id_; | 102 const int gpu_client_id_; |
90 scoped_ptr<base::WaitableEvent> shutdown_event_; | 103 scoped_ptr<base::WaitableEvent> shutdown_event_; |
91 scoped_refptr<GpuChannelHost> gpu_channel_; | 104 scoped_refptr<GpuChannelHost> gpu_channel_; |
92 int gpu_host_id_; | 105 int gpu_host_id_; |
93 scoped_refptr<EstablishRequest> pending_request_; | 106 scoped_refptr<EstablishRequest> pending_request_; |
94 std::vector<base::Closure> established_callbacks_; | 107 std::vector<base::Closure> established_callbacks_; |
95 | 108 |
96 static BrowserGpuChannelHostFactory* instance_; | 109 static BrowserGpuChannelHostFactory* instance_; |
97 | 110 |
98 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 111 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
99 }; | 112 }; |
100 | 113 |
101 } // namespace content | 114 } // namespace content |
102 | 115 |
103 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 116 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
OLD | NEW |