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

Side by Side Diff: ppapi/proxy/ppb_context_3d_proxy.cc

Issue 6588029: Moved creation of GPU command buffer shared memory into the browser process.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « gpu/pgl/command_buffer_pepper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/proxy/ppb_context_3d_proxy.h" 5 #include "ppapi/proxy/ppb_context_3d_proxy.h"
6 6
7 #include "base/hash_tables.h" 7 #include "base/hash_tables.h"
8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
9 #include "gpu/command_buffer/client/gles2_implementation.h" 9 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } // namespace 170 } // namespace
171 171
172 class PepperCommandBuffer : public gpu::CommandBuffer { 172 class PepperCommandBuffer : public gpu::CommandBuffer {
173 public: 173 public:
174 PepperCommandBuffer(const HostResource& resource, 174 PepperCommandBuffer(const HostResource& resource,
175 PluginDispatcher* dispatcher); 175 PluginDispatcher* dispatcher);
176 virtual ~PepperCommandBuffer(); 176 virtual ~PepperCommandBuffer();
177 177
178 // CommandBuffer implementation: 178 // CommandBuffer implementation:
179 virtual bool Initialize(int32 size); 179 virtual bool Initialize(int32 size);
180 virtual bool Initialize(base::SharedMemory* buffer, int32 size);
180 virtual gpu::Buffer GetRingBuffer(); 181 virtual gpu::Buffer GetRingBuffer();
181 virtual State GetState(); 182 virtual State GetState();
182 virtual void Flush(int32 put_offset); 183 virtual void Flush(int32 put_offset);
183 virtual State FlushSync(int32 put_offset); 184 virtual State FlushSync(int32 put_offset);
184 virtual void SetGetOffset(int32 get_offset); 185 virtual void SetGetOffset(int32 get_offset);
185 virtual int32 CreateTransferBuffer(size_t size); 186 virtual int32 CreateTransferBuffer(size_t size);
186 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, 187 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory,
187 size_t size); 188 size_t size);
188 virtual void DestroyTransferBuffer(int32 id); 189 virtual void DestroyTransferBuffer(int32 id);
189 virtual gpu::Buffer GetTransferBuffer(int32 handle); 190 virtual gpu::Buffer GetTransferBuffer(int32 handle);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 num_entries_ = size / sizeof(gpu::CommandBufferEntry); 242 num_entries_ = size / sizeof(gpu::CommandBufferEntry);
242 return true; 243 return true;
243 } 244 }
244 245
245 ring_buffer_.reset(); 246 ring_buffer_.reset();
246 } 247 }
247 248
248 return false; 249 return false;
249 } 250 }
250 251
252 bool PepperCommandBuffer::Initialize(base::SharedMemory* buffer, int32 size) {
253 // Not implemented in proxy.
254 NOTREACHED();
255 return false;
256 }
257
251 gpu::Buffer PepperCommandBuffer::GetRingBuffer() { 258 gpu::Buffer PepperCommandBuffer::GetRingBuffer() {
252 // Return locally cached ring buffer. 259 // Return locally cached ring buffer.
253 gpu::Buffer buffer; 260 gpu::Buffer buffer;
254 buffer.ptr = ring_buffer_->memory(); 261 buffer.ptr = ring_buffer_->memory();
255 buffer.size = num_entries_ * sizeof(gpu::CommandBufferEntry); 262 buffer.size = num_entries_ * sizeof(gpu::CommandBufferEntry);
256 buffer.shared_memory = ring_buffer_.get(); 263 buffer.shared_memory = ring_buffer_.get();
257 return buffer; 264 return buffer;
258 } 265 }
259 266
260 gpu::CommandBuffer::State PepperCommandBuffer::GetState() { 267 gpu::CommandBuffer::State PepperCommandBuffer::GetState() {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 &shm_handle, 607 &shm_handle,
601 &shm_size)) { 608 &shm_size)) {
602 return; 609 return;
603 } 610 }
604 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle); 611 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle);
605 *size = shm_size; 612 *size = shm_size;
606 } 613 }
607 614
608 } // namespace proxy 615 } // namespace proxy
609 } // namespace pp 616 } // namespace pp
OLDNEW
« no previous file with comments | « gpu/pgl/command_buffer_pepper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698