Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: content/browser/gpu/gpu_process_host.h

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_GPU_PROCESS_HOST_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 GPU_PROCESS_KIND_UNSANDBOXED, 58 GPU_PROCESS_KIND_UNSANDBOXED,
59 GPU_PROCESS_KIND_SANDBOXED, 59 GPU_PROCESS_KIND_SANDBOXED,
60 GPU_PROCESS_KIND_COUNT 60 GPU_PROCESS_KIND_COUNT
61 }; 61 };
62 62
63 typedef base::Callback<void(const IPC::ChannelHandle&, const gpu::GPUInfo&)> 63 typedef base::Callback<void(const IPC::ChannelHandle&, const gpu::GPUInfo&)>
64 EstablishChannelCallback; 64 EstablishChannelCallback;
65 65
66 typedef base::Callback<void(bool)> CreateCommandBufferCallback; 66 typedef base::Callback<void(bool)> CreateCommandBufferCallback;
67 67
68 typedef base::Callback<void(const gfx::Size)> CreateImageCallback; 68 typedef base::Callback<void(bool)> CreateImageCallback;
69 69
70 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> 70 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
71 CreateGpuMemoryBufferCallback; 71 CreateGpuMemoryBufferCallback;
72 72
73 static bool gpu_enabled() { return gpu_enabled_; } 73 static bool gpu_enabled() { return gpu_enabled_; }
74 74
75 // Creates a new GpuProcessHost or gets an existing one, resulting in the 75 // Creates a new GpuProcessHost or gets an existing one, resulting in the
76 // launching of a GPU process if required. Returns null on failure. It 76 // launching of a GPU process if required. Returns null on failure. It
77 // is not safe to store the pointer once control has returned to the message 77 // is not safe to store the pointer once control has returned to the message
78 // loop as it can be destroyed. Instead store the associated GPU host ID. 78 // loop as it can be destroyed. Instead store the associated GPU host ID.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Tells the GPU process to create a new command buffer that draws into the 115 // Tells the GPU process to create a new command buffer that draws into the
116 // given surface. 116 // given surface.
117 void CreateViewCommandBuffer( 117 void CreateViewCommandBuffer(
118 const gfx::GLSurfaceHandle& compositing_surface, 118 const gfx::GLSurfaceHandle& compositing_surface,
119 int surface_id, 119 int surface_id,
120 int client_id, 120 int client_id,
121 const GPUCreateCommandBufferConfig& init_params, 121 const GPUCreateCommandBufferConfig& init_params,
122 int route_id, 122 int route_id,
123 const CreateCommandBufferCallback& callback); 123 const CreateCommandBufferCallback& callback);
124 124
125 // Tells the GPU process to create a new image using the given window. 125 // Tells the GPU process to create a new image using the given handle.
126 void CreateImage( 126 void CreateImage(
127 gfx::PluginWindowHandle window, 127 const gfx::GpuMemoryBufferHandle& handle,
128 const gfx::Size& size,
129 unsigned internalformat,
128 int client_id, 130 int client_id,
alexst (slow to review) 2014/06/12 22:29:22 I don't know that it's super important for this pa
reveman 2014/06/13 16:45:11 We could use GpuMemoryBufferId::secondary_id inste
129 int image_id, 131 int image_id,
130 const CreateImageCallback& callback); 132 const CreateImageCallback& callback);
131 133
132 // Tells the GPU process to delete image. 134 // Tells the GPU process to delete image.
133 void DeleteImage(int client_id, int image_id, int sync_point); 135 void DeleteImage(int client_id, int image_id, int sync_point);
134 136
135 void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, 137 void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle,
136 const gfx::Size& size, 138 const gfx::Size& size,
137 unsigned internalformat, 139 unsigned internalformat,
138 unsigned usage, 140 unsigned usage,
(...skipping 27 matching lines...) Expand all
166 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 168 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
167 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; 169 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
168 virtual void OnProcessLaunched() OVERRIDE; 170 virtual void OnProcessLaunched() OVERRIDE;
169 virtual void OnProcessCrashed(int exit_code) OVERRIDE; 171 virtual void OnProcessCrashed(int exit_code) OVERRIDE;
170 172
171 // Message handlers. 173 // Message handlers.
172 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); 174 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info);
173 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); 175 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
174 void OnCommandBufferCreated(bool succeeded); 176 void OnCommandBufferCreated(bool succeeded);
175 void OnDestroyCommandBuffer(int32 surface_id); 177 void OnDestroyCommandBuffer(int32 surface_id);
176 void OnImageCreated(const gfx::Size size); 178 void OnImageCreated(bool succeeded);
177 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); 179 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
178 void OnDidCreateOffscreenContext(const GURL& url); 180 void OnDidCreateOffscreenContext(const GURL& url);
179 void OnDidLoseContext(bool offscreen, 181 void OnDidLoseContext(bool offscreen,
180 gpu::error::ContextLostReason reason, 182 gpu::error::ContextLostReason reason,
181 const GURL& url); 183 const GURL& url);
182 void OnDidDestroyOffscreenContext(const GURL& url); 184 void OnDidDestroyOffscreenContext(const GURL& url);
183 void OnGpuMemoryUmaStatsReceived(const GPUMemoryUmaStats& stats); 185 void OnGpuMemoryUmaStatsReceived(const GPUMemoryUmaStats& stats);
184 #if defined(OS_MACOSX) 186 #if defined(OS_MACOSX)
185 void OnAcceleratedSurfaceBuffersSwapped( 187 void OnAcceleratedSurfaceBuffersSwapped(
186 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); 188 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > 280 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> >
279 SurfaceRefMap; 281 SurfaceRefMap;
280 SurfaceRefMap surface_refs_; 282 SurfaceRefMap surface_refs_;
281 283
282 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 284 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
283 }; 285 };
284 286
285 } // namespace content 287 } // namespace content
286 288
287 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 289 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698