| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/pgl/command_buffer_pepper.h" | 5 #include "gpu/pgl/command_buffer_pepper.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/logging.h" | 7 #include "gpu/command_buffer/common/logging.h" |
| 8 | 8 |
| 9 using base::SharedMemory; | 9 using base::SharedMemory; |
| 10 using gpu::Buffer; | 10 using gpu::Buffer; |
| 11 using gpu::CommandBuffer; | 11 using gpu::CommandBuffer; |
| 12 | 12 |
| 13 CommandBufferPepper::CommandBufferPepper(NPP npp, | 13 CommandBufferPepper::CommandBufferPepper(NPP npp, |
| 14 NPDevice* device, | 14 NPDevice* device, |
| 15 NPDeviceContext3D* context) | 15 NPDeviceContext3D* context) |
| 16 : npp_(npp), | 16 : npp_(npp), |
| 17 device_(device), | 17 device_(device), |
| 18 context_(context) { | 18 context_(context) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 CommandBufferPepper::~CommandBufferPepper() { | 21 CommandBufferPepper::~CommandBufferPepper() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 // Not implemented in CommandBufferPepper. | 24 // Not implemented in CommandBufferPepper. |
| 25 bool CommandBufferPepper::Initialize(int32 size) { | 25 bool CommandBufferPepper::Initialize(int32 size) { |
| 26 GPU_NOTREACHED(); | 26 GPU_NOTREACHED(); |
| 27 return false; | 27 return false; |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool CommandBufferPepper::Initialize(base::SharedMemory* buffer, int32 size) { |
| 31 GPU_NOTREACHED(); |
| 32 return false; |
| 33 } |
| 34 |
| 30 Buffer CommandBufferPepper::GetRingBuffer() { | 35 Buffer CommandBufferPepper::GetRingBuffer() { |
| 31 Buffer buffer; | 36 Buffer buffer; |
| 32 #if defined(ENABLE_NEW_NPDEVICE_API) | 37 #if defined(ENABLE_NEW_NPDEVICE_API) |
| 33 NPDeviceBuffer np_buffer; | 38 NPDeviceBuffer np_buffer; |
| 34 device_->mapBuffer(npp_, | 39 device_->mapBuffer(npp_, |
| 35 context_, | 40 context_, |
| 36 NP3DCommandBufferId, | 41 NP3DCommandBufferId, |
| 37 &np_buffer); | 42 &np_buffer); |
| 38 buffer.ptr = np_buffer.ptr; | 43 buffer.ptr = np_buffer.ptr; |
| 39 buffer.size = np_buffer.size; | 44 buffer.size = np_buffer.size; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 CommandBuffer::State CommandBufferPepper::ConvertState() { | 199 CommandBuffer::State CommandBufferPepper::ConvertState() { |
| 195 CommandBuffer::State state; | 200 CommandBuffer::State state; |
| 196 state.num_entries = context_->commandBufferSize; | 201 state.num_entries = context_->commandBufferSize; |
| 197 state.get_offset = context_->getOffset; | 202 state.get_offset = context_->getOffset; |
| 198 state.put_offset = context_->putOffset; | 203 state.put_offset = context_->putOffset; |
| 199 state.token = context_->token; | 204 state.token = context_->token; |
| 200 state.error = static_cast<gpu::error::Error>( | 205 state.error = static_cast<gpu::error::Error>( |
| 201 context_->error); | 206 context_->error); |
| 202 return state; | 207 return state; |
| 203 } | 208 } |
| OLD | NEW |